From e1ff95fc618f22886b505a8dbfdfa7651e1a3b9b Mon Sep 17 00:00:00 2001 From: Jayesh Date: Jan 07 2020 10:58:29 +0000 Subject: Test for ipa-ca-install on replica Test on replica for ipa-ca-install with options --no-host-dns,--skip-schema-check,done changes in ipatests/pytest_ipa/integration/tasks.py because wants to pass few arguments to install_ca method Signed-off-by: Jayesh Reviewed-By: Florence Blanc-Renaud Reviewed-By: Fraser Tweedale Reviewed-By: Florence Blanc-Renaud --- diff --git a/ipatests/prci_definitions/nightly_ipa-4-8.yaml b/ipatests/prci_definitions/nightly_ipa-4-8.yaml index c6d6aa7..eb956cb 100644 --- a/ipatests/prci_definitions/nightly_ipa-4-8.yaml +++ b/ipatests/prci_definitions/nightly_ipa-4-8.yaml @@ -303,6 +303,18 @@ jobs: timeout: 10800 topology: *master_3repl_1client + fedora-30/test_installation_TestInstallCA: + requires: [fedora-30/build] + priority: 50 + job: + class: RunPytest + args: + build_url: '{fedora-30/build_url}' + test_suite: test_integration/test_installation.py::TestInstallCA + template: *ci-master-f30 + timeout: 10800 + topology: *master_2repl_1client + fedora-30/test_installation_TestInstallWithCA_KRA1: requires: [fedora-30/build] priority: 50 diff --git a/ipatests/pytest_ipa/integration/tasks.py b/ipatests/pytest_ipa/integration/tasks.py old mode 100644 new mode 100755 index 060a342..8a41bbe --- a/ipatests/pytest_ipa/integration/tasks.py +++ b/ipatests/pytest_ipa/integration/tasks.py @@ -1439,13 +1439,18 @@ def install_kra(host, domain_level=None, first_instance=False, raiseonerr=True): return result -def install_ca(host, domain_level=None, first_instance=False, - external_ca=False, cert_files=None, raiseonerr=True): +def install_ca( + host, domain_level=None, first_instance=False, external_ca=False, + cert_files=None, raiseonerr=True, extra_args=() +): if domain_level is None: domain_level = domainlevel(host) check_domain_level(domain_level) command = ["ipa-ca-install", "-U", "-p", host.config.dirman_password, "-P", 'admin', "-w", host.config.admin_password] + if not isinstance(extra_args, (tuple, list)): + raise TypeError("extra_args must be tuple or list") + command.extend(extra_args) # First step of ipa-ca-install --external-ca if external_ca: command.append('--external-ca') diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py index 1e0a68f..43dee0e 100644 --- a/ipatests/test_integration/test_installation.py +++ b/ipatests/test_integration/test_installation.py @@ -227,6 +227,34 @@ class TestInstallWithCA2(InstallTestBase2): super(TestInstallWithCA2, self).test_replica2_ipa_kra_install() +class TestInstallCA(IntegrationTest): + """ + Tests for CA installation on a replica + """ + + num_replicas = 2 + + @classmethod + def install(cls, mh): + tasks.install_master(cls.master, setup_dns=False) + + def test_replica_ca_install_with_no_host_dns(self): + """ + Test for ipa-ca-install --no-host-dns on a replica + """ + + tasks.install_replica(self.master, self.replicas[0], setup_ca=False) + tasks.install_ca(self.replicas[0], extra_args=["--no-host-dns"]) + + def test_replica_ca_install_with_skip_schema_check(self): + """ + Test for ipa-ca-install --skip-schema-check on a replica + """ + + tasks.install_replica(self.master, self.replicas[1], setup_ca=False) + tasks.install_ca(self.replicas[1], extra_args=["--skip-schema-check"]) + + class TestInstallWithCA_KRA1(InstallTestBase1): @classmethod