diff options
author | Jr Aquino <jr.aquino@citrix.com> | 2011-05-31 14:52:35 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-06-06 13:14:38 -0400 |
commit | d7c60205a6232f52eec80126a649b1319ed77974 (patch) | |
tree | 866a291b60129b9f84df69daa894b72e529cdaba /tests | |
parent | 4080a03051b244c061fdc494dec67d3ee97f9a1a (diff) | |
download | freeipa-d7c60205a6232f52eec80126a649b1319ed77974.tar.gz freeipa-d7c60205a6232f52eec80126a649b1319ed77974.tar.xz freeipa-d7c60205a6232f52eec80126a649b1319ed77974.zip |
Add sudorule and hbacrule to memberof and indirectmemberof attributes
Add Add tests for users, groups, hosts and hostgroups to verify membership
Update API to version 2.3
https://fedorahosted.org/freeipa/ticket/1170
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_xmlrpc/test_hbac_plugin.py | 37 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_sudorule_plugin.py | 37 |
2 files changed, 72 insertions, 2 deletions
diff --git a/tests/test_xmlrpc/test_hbac_plugin.py b/tests/test_xmlrpc/test_hbac_plugin.py index 504565477..b2345cc4a 100644 --- a/tests/test_xmlrpc/test_hbac_plugin.py +++ b/tests/test_xmlrpc/test_hbac_plugin.py @@ -24,7 +24,6 @@ from xmlrpc_test import XMLRPC_test, assert_attr_equal from ipalib import api from ipalib import errors - class test_hbac(XMLRPC_test): """ Test the `hbacrule` plugin. @@ -179,6 +178,24 @@ class test_hbac(XMLRPC_test): assert_attr_equal(entry, 'memberuser_user', self.test_user) assert_attr_equal(entry, 'memberuser_group', self.test_group) + def test_9_a_show_user(self): + """ + Test showing a user to verify HBAC rule membership + `xmlrpc.user_show`. + """ + ret = api.Command['user_show'](self.test_user, all=True) + entry = ret['result'] + assert_attr_equal(entry, 'memberof_HBAC rule', self.rule_name) + + def test_9_b_show_group(self): + """ + Test showing a group to verify HBAC rule membership + `xmlrpc.group_show`. + """ + ret = api.Command['group_show'](self.test_group, all=True) + entry = ret['result'] + assert_attr_equal(entry, 'memberof_HBAC rule', self.rule_name) + def test_9_hbacrule_remove_user(self): """ Test removing user and group from HBAC rule using `xmlrpc.hbacrule_remove_user'. @@ -215,6 +232,24 @@ class test_hbac(XMLRPC_test): assert_attr_equal(entry, 'memberhost_host', self.test_host) assert_attr_equal(entry, 'memberhost_hostgroup', self.test_hostgroup) + def test_a_hbacrule_show_host(self): + """ + Test showing host to verify HBAC rule membership + `xmlrpc.host_show`. + """ + ret = api.Command['host_show'](self.test_host, all=True) + entry = ret['result'] + assert_attr_equal(entry, 'memberof_HBAC rule', self.rule_name) + + def test_a_hbacrule_show_hostgroup(self): + """ + Test showing hostgroup to verify HBAC rule membership + `xmlrpc.hostgroup_show`. + """ + ret = api.Command['hostgroup_show'](self.test_hostgroup, all=True) + entry = ret['result'] + assert_attr_equal(entry, 'memberof_HBAC rule', self.rule_name) + def test_b_hbacrule_remove_host(self): """ Test removing host and hostgroup from HBAC rule using `xmlrpc.hbacrule_remove_host`. diff --git a/tests/test_xmlrpc/test_sudorule_plugin.py b/tests/test_xmlrpc/test_sudorule_plugin.py index 4c3ba5a21..3de1adce0 100644 --- a/tests/test_xmlrpc/test_sudorule_plugin.py +++ b/tests/test_xmlrpc/test_sudorule_plugin.py @@ -25,7 +25,6 @@ from xmlrpc_test import XMLRPC_test, assert_attr_equal from ipalib import api from ipalib import errors - class test_sudorule(XMLRPC_test): """ Test the `sudorule` plugin. @@ -155,6 +154,24 @@ class test_sudorule(XMLRPC_test): assert_attr_equal(entry, 'memberuser_user', self.test_user) assert_attr_equal(entry, 'memberuser_group', self.test_group) + def test_9_a_show_user(self): + """ + Test showing a user to verify Sudo rule membership + `xmlrpc.user_show`. + """ + ret = api.Command['user_show'](self.test_user, all=True) + entry = ret['result'] + assert_attr_equal(entry, 'memberof_Sudo Rule', self.rule_name) + + def test_9_b_show_group(self): + """ + Test showing a group to verify Sudo rule membership + `xmlrpc.group_show`. + """ + ret = api.Command['group_show'](self.test_group, all=True) + entry = ret['result'] + assert_attr_equal(entry, 'memberof_Sudo Rule', self.rule_name) + def test_9_sudorule_remove_user(self): """ Test removing user and group from Sudo rule using @@ -359,6 +376,24 @@ class test_sudorule(XMLRPC_test): assert_attr_equal(entry, 'memberhost_host', self.test_host) assert_attr_equal(entry, 'memberhost_hostgroup', self.test_hostgroup) + def test_a_sudorule_show_host(self): + """ + Test showing host to verify Sudo rule membership + `xmlrpc.host_show`. + """ + ret = api.Command['host_show'](self.test_host, all=True) + entry = ret['result'] + assert_attr_equal(entry, 'memberof_Sudo Rule', self.rule_name) + + def test_a_sudorule_show_hostgroup(self): + """ + Test showing hostgroup to verify Sudo rule membership + `xmlrpc.hostgroup_show`. + """ + ret = api.Command['hostgroup_show'](self.test_hostgroup, all=True) + entry = ret['result'] + assert_attr_equal(entry, 'memberof_Sudo Rule', self.rule_name) + def test_b_sudorule_remove_host(self): """ Test removing host and hostgroup from Sudo rule using |