summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOndrej Hamada <ohamada@redhat.com>2012-03-21 13:30:42 +0100
committerMartin Kosek <mkosek@redhat.com>2012-03-22 17:13:39 +0100
commita58cbb985ec007c0ef83010b32408efb2f4784d2 (patch)
tree729c8993d6fe32a3b3b6bbdfb00cabc71a9fb4c3 /tests
parentd14438405a63b2dda91d6965cf0b3111c54f6334 (diff)
downloadfreeipa-a58cbb985ec007c0ef83010b32408efb2f4784d2.tar.gz
freeipa-a58cbb985ec007c0ef83010b32408efb2f4784d2.tar.xz
freeipa-a58cbb985ec007c0ef83010b32408efb2f4784d2.zip
Search allowed attributes in superior objectclasses
get_allowed_attributes function was improved to look for allowed attributes also in the superior objectclasses of specified objectclass. This fixes the regression caused by patch for ticket #2293. Test-case for unit-test was also created. https://fedorahosted.org/freeipa/ticket/2293
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xmlrpc/test_permission_plugin.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_permission_plugin.py b/tests/test_xmlrpc/test_permission_plugin.py
index 68a3cebf9..2ce1bdf31 100644
--- a/tests/test_xmlrpc/test_permission_plugin.py
+++ b/tests/test_xmlrpc/test_permission_plugin.py
@@ -657,6 +657,41 @@ class test_permission(Declarative):
dict(
+ desc='Create permission %r with attributes from superior objectclass' % permission1,
+ command=(
+ 'permission_add', [permission1], dict(
+ type=u'hostgroup',
+ permissions=u'add,delete,write',
+ attrs=u'businessCategory,owner,description',
+ )
+ ),
+ expected=dict(
+ value=permission1,
+ summary=u'Added permission "%s"' % permission1,
+ result=dict(
+ dn=lambda x: DN(x) == permission1_dn,
+ cn=[permission1],
+ objectclass=objectclasses.permission,
+ type=u'hostgroup',
+ permissions=[u'add',u'delete',u'write'],
+ attrs=[u'businesscategory',u'owner',u'description'],
+ ),
+ ),
+ ),
+
+
+ dict(
+ desc='Delete %r' % permission1,
+ command=('permission_del', [permission1], {}),
+ expected=dict(
+ result=dict(failed=u''),
+ value=permission1,
+ summary=u'Deleted permission "%s"' % permission1,
+ ),
+ ),
+
+
+ dict(
desc='Create targetgroup permission %r' % permission1,
command=(
'permission_add', [permission1], dict(