summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2016-06-03 09:21:08 +0200
committerMartin Basti <mbasti@redhat.com>2016-06-06 19:53:59 +0200
commit05878f115334dda75ae9db82e6f31b9f91ec4d2a (patch)
treebc483bf7ac2defcb09b2ea6d2244ba5392494223 /ipatests
parentc4a8e64cdf06cf87112bed383a13e865c8550c5b (diff)
downloadfreeipa-05878f115334dda75ae9db82e6f31b9f91ec4d2a.tar.gz
freeipa-05878f115334dda75ae9db82e6f31b9f91ec4d2a.tar.xz
freeipa-05878f115334dda75ae9db82e6f31b9f91ec4d2a.zip
test: test_cli: Do not expect defaults in kwargs.
Client is no longer forwarding in arguments with default values to the server. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_cmdline/test_cli.py126
1 files changed, 46 insertions, 80 deletions
diff --git a/ipatests/test_cmdline/test_cli.py b/ipatests/test_cmdline/test_cli.py
index c2e051769..a6e6363cb 100644
--- a/ipatests/test_cmdline/test_cli.py
+++ b/ipatests/test_cmdline/test_cli.py
@@ -52,31 +52,18 @@ class TestCLIParsing(object):
self.check_command('ping', 'ping')
def test_user_show(self):
- self.check_command('user-show admin', 'user_show',
- uid=u'admin',
- rights=False,
- no_members=False,
- raw=False,
- all=False)
+ self.check_command('user-show admin', 'user_show', uid=u'admin')
def test_user_show_underscore(self):
- self.check_command('user_show admin', 'user_show',
- uid=u'admin',
- rights=False,
- no_members=False,
- raw=False,
- all=False)
+ self.check_command('user_show admin', 'user_show', uid=u'admin')
def test_group_add(self):
- self.check_command('group-add tgroup1 --desc="Test group"',
+ self.check_command(
+ 'group-add tgroup1 --desc="Test group"',
'group_add',
cn=u'tgroup1',
description=u'Test group',
- nonposix=False,
- external=False,
- no_members=False,
- raw=False,
- all=False)
+ )
def test_sudocmdgroup_add_member(self):
# Test CSV splitting is not done
@@ -86,53 +73,41 @@ class TestCLIParsing(object):
'sudocmdgroup_add_member',
cn=u'tcmdgroup1',
sudocmd=[u'ab,c', u'd'],
- no_members=False,
- raw=False,
- all=False)
+ )
def test_group_add_nonposix(self):
- self.check_command('group-add tgroup1 --desc="Test group" --nonposix',
+ self.check_command(
+ 'group-add tgroup1 --desc="Test group" --nonposix',
'group_add',
cn=u'tgroup1',
description=u'Test group',
nonposix=True,
- external=False,
- no_members=False,
- raw=False,
- all=False)
+ )
def test_group_add_gid(self):
- self.check_command('group-add tgroup1 --desc="Test group" --gid=1234',
+ self.check_command(
+ 'group-add tgroup1 --desc="Test group" --gid=1234',
'group_add',
cn=u'tgroup1',
description=u'Test group',
gidnumber=u'1234',
- nonposix=False,
- external=False,
- no_members=False,
- raw=False,
- all=False)
+ )
def test_group_add_interactive(self):
with self.fake_stdin('Test group\n'):
- self.check_command('group-add tgroup1', 'group_add',
+ self.check_command(
+ 'group-add tgroup1', 'group_add',
cn=u'tgroup1',
- nonposix=False,
- external=False,
- no_members=False,
- raw=False,
- all=False)
+ )
def test_dnsrecord_add(self):
- self.check_command('dnsrecord-add %s ns --a-rec=1.2.3.4' % TEST_ZONE,
+ self.check_command(
+ 'dnsrecord-add %s ns --a-rec=1.2.3.4' % TEST_ZONE,
'dnsrecord_add',
dnszoneidnsname=TEST_ZONE,
idnsname=u'ns',
arecord=u'1.2.3.4',
- structured=False,
- force=False,
- raw=False,
- all=False)
+ )
def test_dnsrecord_del_all(self):
try:
@@ -144,19 +119,21 @@ class TestCLIParsing(object):
dnszoneidnsname=TEST_ZONE,
idnsname=u'ns', arecord=u'1.2.3.4', force=True)
with self.fake_stdin('yes\n'):
- self.check_command('dnsrecord_del %s ns' % TEST_ZONE,
+ self.check_command(
+ 'dnsrecord_del %s ns' % TEST_ZONE,
'dnsrecord_del',
dnszoneidnsname=TEST_ZONE,
idnsname=u'ns',
del_all=True,
- structured=False)
+ )
with self.fake_stdin('YeS\n'):
- self.check_command('dnsrecord_del %s ns' % TEST_ZONE,
+ self.check_command(
+ 'dnsrecord_del %s ns' % TEST_ZONE,
'dnsrecord_del',
dnszoneidnsname=TEST_ZONE,
idnsname=u'ns',
del_all=True,
- structured=False)
+ )
finally:
self.run_command('dnszone_del', idnsname=TEST_ZONE)
@@ -173,13 +150,13 @@ class TestCLIParsing(object):
dnszoneidnsname=TEST_ZONE, idnsname=u'ns',
sshfprecord=record)
with self.fake_stdin('no\nyes\nyes\n'):
- self.check_command('dnsrecord_del %s ns' % TEST_ZONE,
+ self.check_command(
+ 'dnsrecord_del %s ns' % TEST_ZONE,
'dnsrecord_del',
dnszoneidnsname=TEST_ZONE,
idnsname=u'ns',
- del_all=False,
sshfprecord=records,
- structured=False)
+ )
finally:
self.run_command('dnszone_del', idnsname=TEST_ZONE)
@@ -187,48 +164,45 @@ class TestCLIParsing(object):
sshfp_parts = (1, 1, u'E3B72BA346B90570EED94BE9334E34AA795CED23')
with self.fake_stdin('SSHFP\n%d\n%d\n%s' % sshfp_parts):
- self.check_command('dnsrecord-add %s sshfp' % TEST_ZONE,
+ self.check_command(
+ 'dnsrecord-add %s sshfp' % TEST_ZONE,
'dnsrecord_add',
dnszoneidnsname=TEST_ZONE,
idnsname=u'sshfp',
sshfp_part_fp_type=sshfp_parts[0],
sshfp_part_algorithm=sshfp_parts[1],
sshfp_part_fingerprint=sshfp_parts[2],
- structured=False,
- raw=False,
- all=False,
- force=False)
+ )
# NOTE: when a DNS record part is passed via command line, it is not
# converted to its base type when transfered via wire
with self.fake_stdin('%d\n%s' % (sshfp_parts[1], sshfp_parts[2])):
- self.check_command('dnsrecord-add %s sshfp '
- '--sshfp-algorithm=%d' % (TEST_ZONE, sshfp_parts[0]),
+ self.check_command(
+ 'dnsrecord-add %s sshfp --sshfp-algorithm=%d' % (
+ TEST_ZONE, sshfp_parts[0]),
'dnsrecord_add',
dnszoneidnsname=TEST_ZONE,
idnsname=u'sshfp',
sshfp_part_fp_type=sshfp_parts[0],
- sshfp_part_algorithm=unicode(sshfp_parts[1]), # passed via cmdline
+ # passed via cmdline
+ sshfp_part_algorithm=unicode(sshfp_parts[1]),
sshfp_part_fingerprint=sshfp_parts[2],
- structured=False,
- raw=False,
- all=False,
- force=False)
+ )
with self.fake_stdin(sshfp_parts[2]):
- self.check_command('dnsrecord-add %s sshfp '
- '--sshfp-algorithm=%d --sshfp-fp-type=%d' % (
- TEST_ZONE, sshfp_parts[0], sshfp_parts[1]),
+ self.check_command(
+ 'dnsrecord-add %s sshfp --sshfp-algorithm=%d '
+ '--sshfp-fp-type=%d' % (
+ TEST_ZONE, sshfp_parts[0], sshfp_parts[1]),
'dnsrecord_add',
dnszoneidnsname=TEST_ZONE,
idnsname=u'sshfp',
- sshfp_part_fp_type=unicode(sshfp_parts[0]), # passed via cmdline
- sshfp_part_algorithm=unicode(sshfp_parts[1]), # passed via cmdline
+ # passed via cmdline
+ sshfp_part_fp_type=unicode(sshfp_parts[0]),
+ # passed via cmdline
+ sshfp_part_algorithm=unicode(sshfp_parts[1]),
sshfp_part_fingerprint=sshfp_parts[2],
- structured=False,
- raw=False,
- all=False,
- force=False)
+ )
def test_dnsrecord_del_comma(self):
try:
@@ -248,9 +222,7 @@ class TestCLIParsing(object):
'dnsrecord_del',
dnszoneidnsname=TEST_ZONE,
idnsname=u'test',
- del_all=False,
- txtrecord=[u'"A pretty little problem," said Holmes.'],
- structured=False)
+ txtrecord=[u'"A pretty little problem," said Holmes.'])
finally:
self.run_command('dnszone_del', idnsname=TEST_ZONE)
@@ -268,8 +240,6 @@ class TestCLIParsing(object):
ipaidrangesize=u'1',
ipabaserid=5,
ipasecondarybaserid=500000,
- all=False,
- raw=False,
)
def test_with_command_line_options():
@@ -282,8 +252,6 @@ class TestCLIParsing(object):
ipaidrangesize=u'1',
ipabaserid=u'5',
ipasecondarybaserid=u'500000',
- all=False,
- raw=False,
)
def test_without_options():
@@ -293,8 +261,6 @@ class TestCLIParsing(object):
cn=u'range1',
ipabaseid=u'1',
ipaidrangesize=u'1',
- all=False,
- raw=False,
)
adtrust_dn = 'cn=ADTRUST,cn=%s,cn=masters,cn=ipa,cn=etc,%s' % \