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 <jgarg@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
This commit is contained in:
Jayesh 2019-12-16 15:47:20 +05:30 committed by Florence Blanc-Renaud
parent bfc998eae2
commit ad3bf5042d
2 changed files with 35 additions and 2 deletions

9
ipatests/pytest_ipa/integration/tasks.py Normal file → Executable file
View File

@ -1461,13 +1461,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')

View File

@ -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