summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-07-27 10:25:48 -0400
committerRob Crittenden <rcritten@redhat.com>2011-07-27 00:02:28 -0400
commit62445b8673288212ab3cdc1f5b6d1d81457831ac (patch)
tree3113c0c3c0af7e5dcf61ce733b3b79bd6d497e16 /tests/test_xmlrpc
parenta2641254fecae7097cb64da32647199f0155b631 (diff)
downloadfreeipa-62445b8673288212ab3cdc1f5b6d1d81457831ac.tar.gz
freeipa-62445b8673288212ab3cdc1f5b6d1d81457831ac.tar.xz
freeipa-62445b8673288212ab3cdc1f5b6d1d81457831ac.zip
Don't leave dangling map if adding an indirect map fails
When using the add_indirect helper we create a new map and then add a key for it all in one step. If adding the key fails for any reason be sure to remove the map we added. https://fedorahosted.org/freeipa/ticket/1520
Diffstat (limited to 'tests/test_xmlrpc')
-rw-r--r--tests/test_xmlrpc/test_automount_plugin.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_automount_plugin.py b/tests/test_xmlrpc/test_automount_plugin.py
index c5dd619e2..0face2ef0 100644
--- a/tests/test_xmlrpc/test_automount_plugin.py
+++ b/tests/test_xmlrpc/test_automount_plugin.py
@@ -266,6 +266,17 @@ class test_automount_indirect(XMLRPC_test):
assert res
assert_attr_equal(res, 'automountmapname', self.mapname)
+ def test_1a_automountmap_add_indirect(self):
+ """
+ Test adding a duplicate indirect map.
+ """
+ try:
+ api.Command['automountmap_add_indirect'](self.locname, self.mapname, **self.map_kw)['result']
+ except errors.DuplicateEntry:
+ pass
+ else:
+ assert False
+
def test_2_automountmap_show(self):
"""
Test the `xmlrpc.automountmap_show` method.