Raise DuplicateEntry Error when adding a duplicate sudo option

https://fedorahosted.org/freeipa/ticket/1276
https://fedorahosted.org/freeipa/ticket/1277
https://fedorahosted.org/freeipa/ticket/1308

Added new Exception: AttrValueNotFound
Fixed XML Test for Sudorule remove_option
1276 (Raise AttrValueNotFound when trying to remove a non-existent option from Sudo rule)
1277 (Raise DuplicateEntry Error when adding a duplicate sudo option)
1308 (Make sudooption a required option for sudorule_remove_option)
This commit is contained in:
Jr Aquino
2011-06-16 19:21:07 -04:00
committed by Rob Crittenden
parent 0377123b19
commit 44cdf8ef54
5 changed files with 62 additions and 31 deletions
+2 -3
View File
@@ -316,7 +316,6 @@ class test_sudorule(XMLRPC_test):
ret = api.Command['sudorule_add_runasgroup'](
self.rule_name, group=self.test_external_group
)
print ret
assert ret['completed'] == 1
failed = ret['failed']
entry = ret['result']
@@ -330,7 +329,6 @@ class test_sudorule(XMLRPC_test):
ret = api.Command['sudorule_remove_runasgroup'](
self.rule_name, group=self.test_external_group
)
print ret
assert ret['completed'] == 1
failed = ret['failed']
entry = ret['result']
@@ -355,7 +353,8 @@ class test_sudorule(XMLRPC_test):
ret = api.Command['sudorule_remove_option'](
self.rule_name, ipasudoopt=self.test_option
)
assert ret['result'] is True
entry = ret['result']
assert 'ipasudoopt' not in entry
def test_a_sudorule_add_host(self):
"""