summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc/test_group_plugin.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-05-19 13:50:38 +0200
committerMartin Basti <mbasti@redhat.com>2016-05-31 14:08:54 +0200
commit5f42b42bd4557a669ab5cfcf1af6596f1a2535f1 (patch)
tree1e79933fb82d3166dd6a76be453b29728302a795 /ipatests/test_xmlrpc/test_group_plugin.py
parent91572afc60f590f0d81ad18234189a0b48144bf5 (diff)
downloadfreeipa-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_group_plugin.py')
-rw-r--r--ipatests/test_xmlrpc/test_group_plugin.py54
1 files changed, 52 insertions, 2 deletions
diff --git a/ipatests/test_xmlrpc/test_group_plugin.py b/ipatests/test_xmlrpc/test_group_plugin.py
index 41d28f1cf..02467daed 100644
--- a/ipatests/test_xmlrpc/test_group_plugin.py
+++ b/ipatests/test_xmlrpc/test_group_plugin.py
@@ -177,11 +177,11 @@ class TestFindGroup(XMLRPC_test):
group.ensure_exists()
group.find()
- def test_search_for_all_groups(self, group, group2):
+ def test_search_for_all_groups_with_members(self, group, group2):
""" Search for all groups """
group.ensure_exists()
group2.create()
- command = group.make_command('group_find')
+ command = group.make_command('group_find', no_members=False)
result = command()
assert_deepequal(dict(
summary=u'6 groups matched',
@@ -227,6 +227,56 @@ class TestFindGroup(XMLRPC_test):
},
]), result)
+
+ def test_search_for_all_groups(self, group, group2):
+ """ Search for all groups """
+ group.ensure_exists()
+ group2.create()
+ command = group.make_command('group_find')
+ result = command()
+ assert_deepequal(dict(
+ summary=u'6 groups matched',
+ count=6,
+ truncated=False,
+ result=[
+ {
+ 'dn': get_group_dn('admins'),
+ 'gidnumber': [fuzzy_digits],
+ 'cn': [u'admins'],
+ 'description': [u'Account administrators group'],
+ },
+ {
+ 'dn': get_group_dn('editors'),
+ 'gidnumber': [fuzzy_digits],
+ 'cn': [u'editors'],
+ 'description':
+ [u'Limited admins who can edit other users'],
+ },
+ {
+ 'dn': get_group_dn('ipausers'),
+ 'cn': [u'ipausers'],
+ 'description': [u'Default group for all users'],
+ },
+ {
+ 'dn': get_group_dn(group.cn),
+ 'cn': [group.cn],
+ 'description': [u'Test desc1'],
+ 'gidnumber': [fuzzy_digits],
+ },
+ {
+ 'dn': get_group_dn(group2.cn),
+ 'cn': [group2.cn],
+ 'description': [u'Test desc2'],
+ 'gidnumber': [fuzzy_digits],
+ },
+ {
+ 'dn': get_group_dn('trust admins'),
+ 'cn': [u'trust admins'],
+ 'description': [u'Trusts administrators group'],
+ },
+ ]), result)
+
+
def test_search_for_all_posix(self, group, group2):
""" Search for all posix groups """
command = group.make_command(