summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc/test_netgroup_plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipatests/test_xmlrpc/test_netgroup_plugin.py')
-rw-r--r--ipatests/test_xmlrpc/test_netgroup_plugin.py115
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],