diff options
author | Martin Basti <mbasti@redhat.com> | 2016-05-19 13:50:38 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-05-31 14:08:54 +0200 |
commit | 5f42b42bd4557a669ab5cfcf1af6596f1a2535f1 (patch) | |
tree | 1e79933fb82d3166dd6a76be453b29728302a795 /ipatests/test_xmlrpc/test_netgroup_plugin.py | |
parent | 91572afc60f590f0d81ad18234189a0b48144bf5 (diff) | |
download | freeipa-5f42b42bd4557a669ab5cfcf1af6596f1a2535f1.tar.gz freeipa-5f42b42bd4557a669ab5cfcf1af6596f1a2535f1.tar.xz freeipa-5f42b42bd4557a669ab5cfcf1af6596f1a2535f1.zip |
Performance: Find commands: do not process members by default
In all *-find commands, member attributes shouldn't be processed due
high amount fo ldpaserches cause serious performance issues. For this
reason --no-members option is set by default in CLI and API.
To get members in *-find command option --all in CLI is rquired or
'no_members=False' or 'all=True' must be set in API call.
For other commands processing of members stays unchanged. WebUI is not
affected by this change.
https://fedorahosted.org/freeipa/ticket/4995
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc/test_netgroup_plugin.py')
-rw-r--r-- | ipatests/test_xmlrpc/test_netgroup_plugin.py | 115 |
1 files changed, 107 insertions, 8 deletions
diff --git a/ipatests/test_xmlrpc/test_netgroup_plugin.py b/ipatests/test_xmlrpc/test_netgroup_plugin.py index c03566b12..2d2df7c49 100644 --- a/ipatests/test_xmlrpc/test_netgroup_plugin.py +++ b/ipatests/test_xmlrpc/test_netgroup_plugin.py @@ -406,8 +406,9 @@ class test_netgroup(Declarative): dict( - desc='Search for netgroups using no_user', - command=('netgroup_find', [], dict(no_user=user1)), + desc='Search for netgroups using no_user with members', + command=('netgroup_find', [], dict( + no_user=user1, no_members=False)), expected=dict( count=2, truncated=False, @@ -431,6 +432,32 @@ class test_netgroup(Declarative): ), ), + + dict( + desc='Search for netgroups using no_user', + command=('netgroup_find', [], dict(no_user=user1)), + expected=dict( + count=2, + truncated=False, + summary=u'2 netgroups matched', + result=[ + { + 'dn': fuzzy_netgroupdn, + 'cn': [netgroup1], + 'description': [u'Test netgroup 1'], + 'nisdomainname': [u'%s' % api.env.domain], + }, + { + 'dn': fuzzy_netgroupdn, + 'cn': [netgroup2], + 'description': [u'Test netgroup 2'], + 'nisdomainname': [u'%s' % api.env.domain], + }, + ], + ), + ), + + dict( desc="Check %r doesn't match when searching for %s" % (netgroup1, user1), command=('netgroup_find', [], dict(user=user1)), @@ -852,8 +879,9 @@ class test_netgroup(Declarative): ), dict( - desc='Search for %r' % netgroup1, - command=('netgroup_find', [], dict(cn=netgroup1)), + desc='Search for %r with members' % netgroup1, + command=('netgroup_find', [], dict( + cn=netgroup1, no_members=False)), expected=dict( count=1, truncated=False, @@ -875,9 +903,31 @@ class test_netgroup(Declarative): ), ), + dict( - desc='Search for %r using user' % netgroup1, - command=('netgroup_find', [], dict(user=user1)), + desc='Search for %r' % netgroup1, + command=('netgroup_find', [], dict(cn=netgroup1)), + expected=dict( + count=1, + truncated=False, + summary=u'1 netgroup matched', + result=[ + { + 'dn': fuzzy_netgroupdn, + 'cn': [netgroup1], + 'description': [u'Test netgroup 1'], + 'nisdomainname': [u'%s' % api.env.domain], + 'externalhost': [unknown_host], + }, + ], + ), + ), + + + dict( + desc='Search for %r using user with members' % netgroup1, + command=('netgroup_find', [], dict( + user=user1, no_members=False)), expected=dict( count=1, truncated=False, @@ -899,9 +949,31 @@ class test_netgroup(Declarative): ), ), + dict( - desc='Search for all netgroups using empty member user', - command=('netgroup_find', [], dict(user=None)), + desc='Search for %r using user' % netgroup1, + command=('netgroup_find', [], dict(user=user1)), + expected=dict( + count=1, + truncated=False, + summary=u'1 netgroup matched', + result=[ + { + 'dn': fuzzy_netgroupdn, + 'cn': [netgroup1], + 'description': [u'Test netgroup 1'], + 'nisdomainname': [u'%s' % api.env.domain], + 'externalhost': [unknown_host], + }, + ], + ), + ), + + + dict( + desc=('Search for all netgroups using empty member user with ' + 'members'), + command=('netgroup_find', [], dict(user=None, no_members=False)), expected=dict( count=2, truncated=False, @@ -930,6 +1002,33 @@ class test_netgroup(Declarative): ), ), + + dict( + desc='Search for all netgroups using empty member user', + command=('netgroup_find', [], dict(user=None)), + expected=dict( + count=2, + truncated=False, + summary=u'2 netgroups matched', + result=[ + { + 'dn': fuzzy_netgroupdn, + 'cn': [netgroup1], + 'description': [u'Test netgroup 1'], + 'nisdomainname': [u'%s' % api.env.domain], + 'externalhost': [unknown_host], + }, + { + 'dn': fuzzy_netgroupdn, + 'cn': [netgroup2], + 'description': [u'Test netgroup 2'], + 'nisdomainname': [u'%s' % api.env.domain], + }, + ], + ), + ), + + dict( desc='Update %r' % netgroup1, command=('netgroup_mod', [netgroup1], |