Updated the TestExternalCA with the functions introduced for the steps of external CA installation.

Signed-off-by: Mohammad Rizwan Yusuf <myusuf@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Mohammad Rizwan Yusuf authored and Christian Heimes committed 2018-02-06 12:16:14 +01:00
1 parent f1f180985f
commit 1ad27076a5
1 file changed
+8 -19
+8 -19
View File
@@ -95,6 +95,7 @@ def install_server_external_ca_step2(host, ipa_ca_cert, root_ca_cert):
def service_control_dirsrv(host, function):
"""Function to control the dirsrv service i.e start, stop, restart etc"""
dashed_domain = host.domain.realm.replace(".", '-')
dirsrv_service = "dirsrv@%s.service" % dashed_domain
cmd = host.run_command(['systemctl', function, dirsrv_service])
@@ -107,30 +108,18 @@ class TestExternalCA(IntegrationTest):
"""
@tasks.collect_logs
def test_external_ca(self):
# Step 1 of ipa-server-install
self.master.run_command([
'ipa-server-install', '-U',
'-a', self.master.config.admin_password,
'-p', self.master.config.dirman_password,
'--setup-dns', '--no-forwarders',
'-n', self.master.domain.name,
'-r', self.master.domain.realm,
'--domain-level=%i' % self.master.config.domain_level,
'--external-ca'
])
# Step 1 of ipa-server-install.
result = install_server_external_ca_step1(self.master)
assert result.returncode == 0
# Sign CA, transport it to the host and get ipa a root ca paths.
root_ca_fname, ipa_ca_fname = tasks.sign_ca_and_transport(
self.master, paths.ROOT_IPA_CSR, ROOT_CA, IPA_CA)
# Step 2 of ipa-server-install
self.master.run_command([
'ipa-server-install',
'-a', self.master.config.admin_password,
'-p', self.master.config.dirman_password,
'--external-cert-file', ipa_ca_fname,
'--external-cert-file', root_ca_fname
])
# Step 2 of ipa-server-install.
result = install_server_external_ca_step2(
self.master, ipa_ca_fname, root_ca_fname)
assert result.returncode == 0
# Make sure IPA server is working properly
tasks.kinit_admin(self.master)