diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-03-26 16:02:48 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-03-26 16:02:48 -0400 |
commit | 602591cae12323012693f49de3ba59516b40c3f5 (patch) | |
tree | f24231c3cb9badc6809f57b5de1d2080688a5aac /tests | |
parent | a6a82750ac3cab01fbafdd689a7ea1f5f6dc0bf7 (diff) | |
download | third_party-cobbler-602591cae12323012693f49de3ba59516b40c3f5.tar.gz third_party-cobbler-602591cae12323012693f49de3ba59516b40c3f5.tar.xz third_party-cobbler-602591cae12323012693f49de3ba59516b40c3f5.zip |
Add a --owner to all the objects, plus associated API calls and backend stuff, for use with the (pending real soon now)
authz_ownership module. Also updated docs. Incidentally, self.settings.tftpboot is now utils.tftpboot_location() --
which is required because tftpboot moves around. Previously this was masked to still look like a settings variable
but I decided to remove the hack. All code using that location has been updated appropriately.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/tests.py b/tests/tests.py index 99ba0b9..3fb4177 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -100,6 +100,41 @@ class BootTest(unittest.TestCase): self.assertTrue(self.api.add_system(system)) self.assertTrue(self.api.find_system(name="drwily.rdu.redhat.com")) + repo = self.api.new_repo() + try: + os.makedirs("/tmp/test_example_cobbler_repo") + except: + pass + fd = open("/tmp/test_example_cobbler_repo/test.file", "w+") + fd.write("hello!") + fd.close() + self.assertTrue(repo.set_name("test_repo")) + self.assertTrue(repo.set_mirror("/tmp/test_example_cobbler_repo")) + self.assertTrue(self.api.repos().add(repo)) + + +class Ownership(BootTest): + + def test_ownership_params(self): + return # FIXME + + # NOTE: these tests are relaeively weak because they only test + # that the options are usable, not that they work, since cobbler + # as a command line tool ignores them, and cobblerd only cares + # in certain modes. + distro = self.api.find_distro(name="testdistro0") + profile = self.api.find_distro(name="testprofile0") + system = self.api.find_distro(name="drwily.rdu.redhat.com") + repo = self.api.find_repo(name="test_repo") + self.assertTrue(distro.set_owners("a,b")) + self.assertTrue(profile.set_owners("c,d")) + self.assertTrue(system.set_owners("e")) + self.assertTrue(repo.set_owners("f,g")) + self.api.add_distro(distro) + self.api.add_profile(profile) + self.api.add_system(system) + self.api.add_repo(repo) + class MultiNIC(BootTest): def test_multi_nic_support(self): |