diff options
author | Pavel Zuna <pzuna@redhat.com> | 2009-11-18 16:39:12 +0100 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-12-01 10:38:49 -0500 |
commit | 40368f0d01566916cfe2476edec34048e336db60 (patch) | |
tree | c1607c4b827fb62a8f97f1b77630b023bbf5071f /tests/test_xmlrpc | |
parent | 0dcaea8d16d976e1d132b6eac03bb2961b6396ae (diff) | |
download | freeipa-40368f0d01566916cfe2476edec34048e336db60.tar.gz freeipa-40368f0d01566916cfe2476edec34048e336db60.tar.xz freeipa-40368f0d01566916cfe2476edec34048e336db60.zip |
Add {user,host,sourcehost}Category to HBAC and make accessTime multivalue.
Diffstat (limited to 'tests/test_xmlrpc')
-rw-r--r-- | tests/test_xmlrpc/test_hbac_plugin.py | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/tests/test_xmlrpc/test_hbac_plugin.py b/tests/test_xmlrpc/test_hbac_plugin.py index caa916acf..0393d68d2 100644 --- a/tests/test_xmlrpc/test_hbac_plugin.py +++ b/tests/test_xmlrpc/test_hbac_plugin.py @@ -34,6 +34,7 @@ class test_hbac(XMLRPC_test): rule_type_fail = u'value not allowed' rule_service = u'ssh' rule_time = u'absolute 20081010000000 ~ 20081015120000' + rule_time2 = u'absolute 20081010000000 ~ 20081016120000' # wrong time, has 30th day in February in first date rule_time_fail = u'absolute 20080230000000 ~ 20081015120000' rule_desc = u'description' @@ -59,8 +60,8 @@ class test_hbac(XMLRPC_test): assert_attr_equal(res, 'cn', self.rule_name) assert_attr_equal(res, 'accessruletype', self.rule_type) assert_attr_equal(res, 'servicename', self.rule_service) - assert_attr_equal(res, 'ipaenabledflag', 'enabled') assert_attr_equal(res, 'accesstime', self.rule_time) + assert_attr_equal(res, 'ipaenabledflag', 'TRUE') assert_attr_equal(res, 'description', self.rule_desc) def test_1_hbac_add(self): @@ -85,8 +86,8 @@ class test_hbac(XMLRPC_test): assert_attr_equal(res, 'cn', self.rule_name) assert_attr_equal(res, 'accessruletype', self.rule_type) assert_attr_equal(res, 'servicename', self.rule_service) - assert_attr_equal(res, 'ipaenabledflag', 'enabled') assert_attr_equal(res, 'accesstime', self.rule_time) + assert_attr_equal(res, 'ipaenabledflag', 'TRUE') assert_attr_equal(res, 'description', self.rule_desc) def test_3_hbac_mod(self): @@ -99,25 +100,23 @@ class test_hbac(XMLRPC_test): assert res assert_attr_equal(res, 'description', self.rule_desc_mod) - def test_4_hbac_mod(self): + def test_4_hbac_add_accesstime(self): """ - Test setting invalid type of HBAC rule using `xmlrpc.hbac_mod`. + Test adding access time to HBAC rule using `xmlrpc.hbac_add_accesstime`. """ - try: - (dn, res) = api.Command['hbac_mod']( - self.rule_name, accessruletype=self.rule_type_fail - ) - except errors.ValidationError: - pass - else: - assert False + (dn, res) = api.Command['hbac_add_accesstime']( + self.rule_name, accesstime=self.rule_time2 + ) + assert res + assert_attr_equal(res, 'accesstime', self.rule_time); + assert_attr_equal(res, 'accesstime', self.rule_time2); - def test_5_hbac_mod(self): + def test_5_hbac_add_accesstime(self): """ - Test setting invalid time in HBAC rule using `xmlrpc.hbac_mod`. + Test adding invalid access time to HBAC rule using `xmlrpc.hbac_add_accesstime`. """ try: - (dn, res) = api.Command['hbac_mod']( + api.Command['hbac_add_accesstime']( self.rule_name, accesstime=self.rule_time_fail ) except errors.ValidationError: |