From ae2506b839ba787dc06004d2eab5cb528379186f Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 23 Mar 2007 16:36:36 -0400 Subject: This is 0.4.5 --- tests/tests.py | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'tests/tests.py') diff --git a/tests/tests.py b/tests/tests.py index 2a663e6..e58b8da 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -188,11 +188,6 @@ class Additions(BootTest): self.assertTrue(profile.set_distro("testdistro0")) self.assertTrue(profile.set_kickstart("http://127.0.0.1/foo")) # no slashes or wildcards in name - self.assertTrue(profile.set_virt_name("virt")) - self.assertTrue(profile.set_virt_name("virt")) - self.failUnlessRaises(CobblerException, profile.set_virt_name, "virt/foo") - self.failUnlessRaises(CobblerException, profile.set_virt_name, "virt*foo") - self.failUnlessRaises(CobblerException, profile.set_virt_name, "virt?foo") # sizes must be integers self.assertTrue(profile.set_virt_file_size("54321")) # temporarily commenting out failing test @@ -299,46 +294,6 @@ class TestCLIBasic(BootTest): app = "/usr/bin/python" self.assertTrue(subprocess.call([app,"cobbler/cobbler.py","list"]) == 0) -class TestImport(BootTest): - - def test_import(self): - # testing the import code. - self.api.clear() - cwd = os.getcwd() - tests = os.path.join(cwd,"tests","import_testdata") - self.api.import_tree(tests, None, None) - self.api.serialize() - - # below: - # partial name of distro: current count, passing count, required arch - haystacks = { - "import_testdata_RHEL-4_U4_AS_ia64_tree_images_pxeboot" : [0, 1, "ia64" ], - "import_testdata_RHEL-4_U4_AS_i386_tree_images_pxeboot" : [0, 1, "x86" ], - "import_testdata_RHEL-4_U4_AS_x86_64_tree_images_pxeboot" : [0, 1, "x86_64" ], - "import_testdata_core_5_i386_os_images_pxeboot" : [ 0, 1, "x86" ], - "import_testdata_core_5_i386_os_images_xen" : [0, 1, "x86" ], - } - - # first go through all found distros and count the matches - for distro in self.api.distros(): - got_it = False - for match in haystacks.keys(): - if distro.name.find(match) != -1: - found = haystacks[match] - found[0] = found[0] + 1 - # check for architecture mismatches - self.failUnlessEqual(distro.arch, found[2], "architecture detection: %s vs %s on %s" % (distro.arch, found[2], distro.name)) - got_it = True - if not got_it: # hasn't :) - self.fail("imported foreign distro: %s" % distro.name) - - # now check the required number of matches vs actual. - # this checks to ensure unsupported arches aren't imported and there - # are no duplicate imports - for match in haystacks.keys(): - found = haystacks[match] - self.failUnlessEqual(found[0], found[1], "mismatched counts: %d vs %d for %s" % (found[0], found[1], match)) - if __name__ == "__main__": if not os.path.exists("setup.py"): print "tests: must invoke from top level directory" -- cgit