summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-01-26 13:41:39 +0100
committerEndi S. Dewata <edewata@redhat.com>2012-01-26 10:17:39 -0600
commit0b9279a30a04de447b324eeb87e7a9e3b288bb1d (patch)
treeac2633d9c3c3e65908c56c883c1045f82c36032b /tests
parent4277253b837f1485a900abee2b5fd0c246fa8d50 (diff)
downloadfreeipa-0b9279a30a04de447b324eeb87e7a9e3b288bb1d.tar.gz
freeipa-0b9279a30a04de447b324eeb87e7a9e3b288bb1d.tar.xz
freeipa-0b9279a30a04de447b324eeb87e7a9e3b288bb1d.zip
Add missing managing hosts filtering options
Host object has a virtual attribute "managing" containing all hosts it manages (governed by managedBy attribute). This patch also adds standard membership filtering options: --man-hosts=HOSTS: Only hosts managing _all_ HOSTS are returned --not-man-hosts=HOSTS: Only hosts which do not manage _any_ host in HOSTS are returned https://fedorahosted.org/freeipa/ticket/1675
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xmlrpc/test_host_plugin.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py
index 9459aec39..372ee256e 100644
--- a/tests/test_xmlrpc/test_host_plugin.py
+++ b/tests/test_xmlrpc/test_host_plugin.py
@@ -391,6 +391,39 @@ class test_host(Declarative):
),
dict(
+ desc='Search for hosts with --man-hosts and --not-man-hosts',
+ command=('host_find', [], {'man_host' : fqdn3, 'not_man_host' : fqdn1}),
+ expected=dict(
+ count=1,
+ truncated=False,
+ summary=u'1 host matched',
+ result=[
+ dict(
+ dn=lambda x: DN(x) == dn3,
+ fqdn=[fqdn3],
+ description=[u'Test host 2'],
+ l=[u'Undisclosed location 2'],
+ krbprincipalname=[u'host/%s@%s' % (fqdn3, api.env.realm)],
+ has_keytab=False,
+ has_password=False,
+ managedby_host=[u'%s' % fqdn3, u'%s' % fqdn1],
+ ),
+ ],
+ ),
+ ),
+
+ dict(
+ desc='Try to search for hosts with --man-hosts',
+ command=('host_find', [], {'man_host' : [fqdn3,fqdn4]}),
+ expected=dict(
+ count=0,
+ truncated=False,
+ summary=u'0 hosts matched',
+ result=[],
+ ),
+ ),
+
+ dict(
desc='Remove managedby_host %r from %r' % (fqdn1, fqdn3),
command=('host_remove_managedby', [fqdn3],
dict(