summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-10-09 16:56:17 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-10-18 12:27:40 +0200
commitc97f4e8a66ce55df3c32d4a198043ad2e7e8e9cd (patch)
tree7559a6e5d8de6b5cce221fd622ec37e615ae3254 /ipatests
parent7be79dfe34317b8002803fd858a275bf70b41e21 (diff)
downloadfreeipa.git-c97f4e8a66ce55df3c32d4a198043ad2e7e8e9cd.tar.gz
freeipa.git-c97f4e8a66ce55df3c32d4a198043ad2e7e8e9cd.tar.xz
freeipa.git-c97f4e8a66ce55df3c32d4a198043ad2e7e8e9cd.zip
Use new CLI options in certinstall tests
The --pin and --dirman-password options simplified ipa-certinstall usage. Use them in tests. Also add tests for the old way of calling the command. https://fedorahosted.org/freeipa/ticket/3869 http://www.freeipa.org/page/V3/ipa-server-certinstall_CLI_cleanup
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_integration/test_caless.py45
1 files changed, 33 insertions, 12 deletions
diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py
index ed0554c6..9866705b 100644
--- a/ipatests/test_integration/test_caless.py
+++ b/ipatests/test_integration/test_caless.py
@@ -1235,24 +1235,21 @@ class TestCertinstall(CALessBase):
def certinstall(self, mode, cert_nick=None, cert_exists=True,
filename='server.p12', pin=_DEFAULT, stdin_text=None,
- p12_pin=None):
+ p12_pin=None, args=None):
if cert_nick:
self.export_pkcs12(cert_nick, password=p12_pin)
if pin is _DEFAULT:
pin = self.cert_password
if cert_exists:
self.copy_cert(self.master, filename)
- args = ['ipa-server-certinstall',
- '-%s' % mode, filename]
- if pin is not None:
- option = {'w': '--http_pin', 'd': '--dirsrv_pin'}[mode]
- args += [option, pin]
- if mode == 'd':
- if stdin_text:
- stdin_text = '%s\n%s' % (self.master.config.dirman_password,
- stdin_text)
- else:
- stdin_text = self.master.config.dirman_password + '\n'
+ if not args:
+ args = ['ipa-server-certinstall',
+ '-%s' % mode, filename]
+ if pin is not None:
+ args += ['--pin', pin]
+ if mode == 'd':
+ args += ['--dirman-password',
+ self.master.config.dirman_password]
return self.master.run_command(args,
raiseonerr=False,
stdin_text=stdin_text)
@@ -1437,3 +1434,27 @@ class TestCertinstall(CALessBase):
result = self.certinstall('d', 'ca1/server', pin='', p12_pin='')
assert result.returncode == 0
+
+ def test_http_old_options(self):
+ "Install new valid DS certificate using pre-v3.3 CLI options"
+ # http://www.freeipa.org/page/V3/ipa-server-certinstall_CLI_cleanup
+
+ args = ['ipa-server-certinstall',
+ '-w', 'server.p12',
+ '--http_pin', self.cert_password]
+
+ result = self.certinstall('w', 'ca1/server', args=args)
+ assert result.returncode == 0
+
+ def test_ds_old_options(self):
+ "Install new valid DS certificate using pre-v3.3 CLI options"
+ # http://www.freeipa.org/page/V3/ipa-server-certinstall_CLI_cleanup
+
+ args = ['ipa-server-certinstall',
+ '-d', 'server.p12',
+ '--dirsrv_pin', self.cert_password]
+ stdin_text = self.master.config.dirman_password + '\n'
+
+ result = self.certinstall('d', 'ca1/server',
+ args=args, stdin_text=stdin_text)
+ assert result.returncode == 0