diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-08-08 12:21:13 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-08-08 12:21:13 -0400 |
commit | ccc5539556c0518c9439cbc5ae2a9322ea866a79 (patch) | |
tree | 299ba8f8db6e4d9502992e3ad00ffd456d8153c4 | |
parent | 39693b93c0140a68588f1a3857733117e54c0504 (diff) | |
download | cobbler-ccc5539556c0518c9439cbc5ae2a9322ea866a79.tar.gz cobbler-ccc5539556c0518c9439cbc5ae2a9322ea866a79.tar.xz cobbler-ccc5539556c0518c9439cbc5ae2a9322ea866a79.zip |
Add images to basic unit tests to ensure they do not break any generalized systems/profile logic. One small fix to profiles to deal with this.
-rw-r--r-- | cobbler/collection_profiles.py | 2 | ||||
-rw-r--r-- | tests/tests.py | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/cobbler/collection_profiles.py b/cobbler/collection_profiles.py index 139c94e8..f88291e7 100644 --- a/cobbler/collection_profiles.py +++ b/cobbler/collection_profiles.py @@ -41,7 +41,7 @@ class Profiles(collection.Collection): if not recursive: for v in self.config.systems(): - if v.profile.lower() == name: + if v.profile is not None and v.profile.lower() == name: raise CX(_("removal would orphan system: %s") % v.name) obj = self.find(name=name) diff --git a/tests/tests.py b/tests/tests.py index 7c4c6bf0..40f3a939 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -16,6 +16,8 @@ from cobbler import settings from cobbler import collection_distros from cobbler import collection_profiles from cobbler import collection_systems +from cobbler import collection_repos +from cobbler import collection_images import cobbler.modules.authz_ownership as authz_module from cobbler import api @@ -102,6 +104,11 @@ class BootTest(unittest.TestCase): self.assertTrue(repo.set_mirror("/tmp/test_example_cobbler_repo")) self.assertTrue(self.api.repos().add(repo)) + image = self.api.new_image() + self.assertTrue(image.set_name("test_image")) + self.assertTrue(image.set_file("/etc/hosts")) # meaningless path + self.assertTrue(self.api.images().add(image)) + class DuplicateNamesAndIpPrevention(BootTest): """ |