summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc/test_permission_plugin.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-09-19 12:34:14 +0200
committerMartin Kosek <mkosek@redhat.com>2014-09-25 13:21:28 +0200
commitf3b1471af946c7231447b36ea4196bb3278d6a1b (patch)
treeba3b851223f39583ea7051150c644333ef589680 /ipatests/test_xmlrpc/test_permission_plugin.py
parentc81acfff43042421b06873e66a04c1aebe89579b (diff)
downloadfreeipa-f3b1471af946c7231447b36ea4196bb3278d6a1b.tar.gz
freeipa-f3b1471af946c7231447b36ea4196bb3278d6a1b.tar.xz
freeipa-f3b1471af946c7231447b36ea4196bb3278d6a1b.zip
test_permission_plugin: Check legacy permissions
Currently a number of v2 permissions are in $SUFFIX, which the original test did not anticipate. Properly check that legacy permissions are found. Reviewed-By: Martin Kosek <mkosek@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc/test_permission_plugin.py')
-rw-r--r--ipatests/test_xmlrpc/test_permission_plugin.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/ipatests/test_xmlrpc/test_permission_plugin.py b/ipatests/test_xmlrpc/test_permission_plugin.py
index bb772050b..f58fa88ca 100644
--- a/ipatests/test_xmlrpc/test_permission_plugin.py
+++ b/ipatests/test_xmlrpc/test_permission_plugin.py
@@ -2842,19 +2842,27 @@ class test_permission_flags(Declarative):
'Permission with unknown flag ?? may not be modified or removed'))
+def check_legacy_results(results):
+ """Check that the expected number of legacy permissions are in $SUFFIX"""
+ legacy_permissions = [p for p in results
+ if not p.get('ipapermissiontype')]
+ print legacy_permissions
+ assert len(legacy_permissions) == 8, len(legacy_permissions)
+ return True
+
class test_permission_legacy(Declarative):
"""Tests for non-upgraded permissions"""
tests = [
dict(
- desc='Search for all permissions in $SUFFIX',
+ desc='Check that some legacy permission is found in $SUFFIX',
command=('permission_find', [],
{'ipapermlocation': api.env.basedn}),
expected=dict(
- count=16,
+ count=lambda count: count,
truncated=False,
- summary=u'16 permissions matched',
- result=lambda s: True,
+ summary=lambda s: True,
+ result=check_legacy_results,
),
),
]