Skip to content

Commit

Permalink
xmlrpc tests: add a test for idview-apply on a master
Browse files Browse the repository at this point in the history
Add a new XMLRPC test trying to apply an IDview:
- to a master
- to a hostgroup containing a master
The command must refuse to apply the IDview to a master node.

Related: https://pagure.io/freeipa/issue/5662

Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
  • Loading branch information
flo-renaud authored and tiran committed Mar 19, 2020
1 parent e08f7a9 commit 20d601e
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions ipatests/test_xmlrpc/test_idviews_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,54 @@ class test_idviews(Declarative):
),


# Test ID View applying to a master
# Try to apply to the localhost = master
dict(
desc=u'Apply %s to %s' % (idview1, api.env.host),
command=(
'idview_apply',
[idview1],
dict(host=api.env.host)
),
expected=dict(
completed=0,
succeeded=dict(
host=tuple(),
),
failed=dict(
memberhost=dict(
host=([api.env.host,
u'ID View cannot be applied to IPA master'],),
hostgroup=tuple(),
),
),
summary=u'Applied ID View "%s"' % idview1,
),
),
# Try to apply to the group ipaservers = all masters
dict(
desc=u'Apply %s to %s' % (idview1, 'ipaservers'),
command=(
'idview_apply',
[idview1],
dict(hostgroup=u'ipaservers')
),
expected=dict(
completed=0,
succeeded=dict(
host=tuple(),
),
failed=dict(
memberhost=dict(
host=([api.env.host,
u'ID View cannot be applied to IPA master'],),
hostgroup=tuple(),
),
),
summary=u'Applied ID View "%s"' % idview1,
),
),

# Test ID View applying

dict(
Expand Down

0 comments on commit 20d601e

Please sign in to comment.