diff options
author | Rob Crittenden <rcritten@redhat.com> | 2012-05-11 15:28:03 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-05-14 10:07:41 +0200 |
commit | 95bb8d0f45c3061035633c7b9c3b1609b11a158d (patch) | |
tree | 815f45e8ecc3724b87777b557fd59af0e77bc643 /tests | |
parent | 472f9fc5aad845afa335786599ba75603c006d31 (diff) | |
download | freeipa-95bb8d0f45c3061035633c7b9c3b1609b11a158d.tar.gz freeipa-95bb8d0f45c3061035633c7b9c3b1609b11a158d.tar.xz freeipa-95bb8d0f45c3061035633c7b9c3b1609b11a158d.zip |
Fix overlapping cn param/option issue, pass cn as aciname in find
permission-find --name wasn't working for two reasons. The first
was that the cn to search on in options ended up overlapping the
primary key name causing the request to fail.
The second reason was aci uses aciname, not cn, as its name field.
So searching on --name matched everything because it was as if you
were searching on nothing.
https://fedorahosted.org/freeipa/ticket/2320
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_xmlrpc/test_permission_plugin.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_permission_plugin.py b/tests/test_xmlrpc/test_permission_plugin.py index 14cfcbc78..54d155aca 100644 --- a/tests/test_xmlrpc/test_permission_plugin.py +++ b/tests/test_xmlrpc/test_permission_plugin.py @@ -227,6 +227,38 @@ class test_permission(Declarative): dict( + desc='Search for %r using --name' % permission1, + command=('permission_find', [], {'cn': permission1}), + expected=dict( + count=1, + truncated=False, + summary=u'1 permission matched', + result=[ + { + 'dn': lambda x: DN(x) == permission1_dn, + 'cn': [permission1], + 'member_privilege': [privilege1], + 'type': u'user', + 'permissions': [u'write'], + }, + ], + ), + ), + + + dict( + desc='Search for non-existence permission using --name', + command=('permission_find', [], {'cn': u'notfound'}), + expected=dict( + count=0, + truncated=False, + summary=u'0 permissions matched', + result=[], + ), + ), + + + dict( desc='Search for %r' % privilege1, command=('permission_find', [privilege1], {}), expected=dict( |