diff options
author | Petr Viktorin <pviktori@redhat.com> | 2014-09-19 12:34:14 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-09-25 13:21:28 +0200 |
commit | 6f100c50f0c9d125ae09fd7a84ae2f801a3707fd (patch) | |
tree | a6dab7e72477f571987bf3212381ed841d18e8cb /ipatests | |
parent | 32b6eb5110b2f851fbedb39ac0d853b46087465f (diff) | |
download | freeipa-6f100c50f0c9d125ae09fd7a84ae2f801a3707fd.tar.gz freeipa-6f100c50f0c9d125ae09fd7a84ae2f801a3707fd.tar.xz freeipa-6f100c50f0c9d125ae09fd7a84ae2f801a3707fd.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')
-rw-r--r-- | ipatests/test_xmlrpc/test_permission_plugin.py | 16 |
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, ), ), ] |