summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-12-20 15:00:00 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-12-20 15:00:00 -0700
commit6fdf5d1e7bb2171646e17cac835be54a4104b5ac (patch)
tree85c084784809b3592d109a116792a0621130146f /tests/test_xmlrpc
parent9a69adeef001ddd0c55513271cf02eedc0a9aef8 (diff)
parentc025ed6404e147f19b71b398e920fd1b3a05452a (diff)
downloadfreeipa-6fdf5d1e7bb2171646e17cac835be54a4104b5ac.tar.gz
freeipa-6fdf5d1e7bb2171646e17cac835be54a4104b5ac.tar.xz
freeipa-6fdf5d1e7bb2171646e17cac835be54a4104b5ac.zip
Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2
Diffstat (limited to 'tests/test_xmlrpc')
-rw-r--r--tests/test_xmlrpc/test_automount_plugin.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_automount_plugin.py b/tests/test_xmlrpc/test_automount_plugin.py
index 2a9ffc4ea..522ee689a 100644
--- a/tests/test_xmlrpc/test_automount_plugin.py
+++ b/tests/test_xmlrpc/test_automount_plugin.py
@@ -182,3 +182,62 @@ class test_Service(XMLRPC_test):
pass
else:
assert False
+
+class test_Indirect(XMLRPC_test):
+ """
+ Test the `f_automount` plugin Indirect map function.
+ """
+ mapname='auto.home'
+ keyname='/home'
+ parentmap='auto.master'
+ description='Home directories'
+ map_kw={'automountkey': keyname, 'parentmap': parentmap, 'description': description}
+
+ def test_add_indirect(self):
+ """
+ Test adding an indirect map.
+ """
+ res = api.Command['automount_addindirectmap'](self.mapname, **self.map_kw)
+ assert res
+ assert res.get('automountinformation','') == self.mapname
+
+ def test_doshowkey(self):
+ """
+ Test the `xmlrpc.automount_showkey` method.
+ """
+ showkey_kw={'automountmapname': self.parentmap, 'automountkey': self.keyname}
+ res = api.Command['automount_showkey'](**showkey_kw)
+ assert res
+ assert res.get('automountkey','') == self.keyname
+
+ def test_remove_key(self):
+ """
+ Remove the indirect key /home
+ """
+ delkey_kw={'automountmapname': self.parentmap, 'automountkey': self.keyname}
+ res = api.Command['automount_delkey'](**delkey_kw)
+ assert res == True
+
+ # Verify that it is gone
+ try:
+ res = api.Command['automount_showkey'](**delkey_kw)
+ except errors.NotFound:
+ pass
+ else:
+ assert False
+
+ def test_remove_map(self):
+ """
+ Remove the indirect map for auto.home
+ """
+ res = api.Command['automount_delmap'](self.mapname)
+ assert res == True
+
+ # Verify that it is gone
+ try:
+ res = api.Command['automount_showmap'](self.mapname)
+ except errors.NotFound:
+ pass
+ else:
+ assert False
+