diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index 95234506d..6620d12c6 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -249,9 +249,9 @@ def enable_replication_debugging(host): stdin_text=logging_ldif) -def install_master(host, setup_dns=True, setup_kra=False, extra_args=(), - domain_level=None, unattended=True, stdin_text=None, - raiseonerr=True): +def install_master(host, setup_dns=True, setup_kra=False, setup_adtrust=False, + extra_args=(), domain_level=None, unattended=True, + stdin_text=None, raiseonerr=True): if domain_level is None: domain_level = host.config.domain_level setup_server_logs_collecting(host) @@ -275,6 +275,8 @@ def install_master(host, setup_dns=True, setup_kra=False, extra_args=(), '--forwarder', host.config.dns_forwarder, '--auto-reverse' ]) + if setup_adtrust: + args.append('--setup-adtrust') args.extend(extra_args) result = host.run_command(args, raiseonerr=raiseonerr, @@ -343,8 +345,9 @@ def replica_prepare(master, replica, extra_args=(), def install_replica(master, replica, setup_ca=True, setup_dns=False, - setup_kra=False, extra_args=(), domain_level=None, - unattended=True, stdin_text=None, raiseonerr=True): + setup_kra=False, setup_adtrust=False, extra_args=(), + domain_level=None, unattended=True, stdin_text=None, + raiseonerr=True): if domain_level is None: domain_level = domainlevel(master) apply_common_fixes(replica) @@ -367,6 +370,8 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False, '--setup-dns', '--forwarder', replica.config.dns_forwarder ]) + if setup_adtrust: + args.append('--setup-adtrust') if master_authoritative_for_client_domain(master, replica): args.extend(['--ip-address', replica.ip]) diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py index 0929f1323..f3e9ebac1 100644 --- a/ipatests/test_integration/test_installation.py +++ b/ipatests/test_integration/test_installation.py @@ -84,6 +84,29 @@ class InstallTestBase2(IntegrationTest): tasks.install_kra(self.replicas[2]) +class ADTrustInstallTestBase(IntegrationTest): + """ + Base test for builtin AD trust installation im combination with other + components + """ + num_replicas = 2 + topology = 'star' + + @classmethod + def install(cls, mh): + tasks.install_master(cls.master, setup_dns=False) + + def install_replica(self, replica, **kwargs): + tasks.install_replica(self.master, replica, setup_adtrust=True, + **kwargs) + + def test_replica0_only_adtrust(self): + self.install_replica(self.replicas[0], setup_ca=False) + + def test_replica1_all_components_adtrust(self): + self.install_replica(self.replicas[1], setup_ca=True) + + ## # Master X Replicas installation tests ## @@ -213,6 +236,32 @@ class TestInstallWithCA_KRA_DNS2(InstallTestBase2): tasks.install_master(cls.master, setup_dns=True, setup_kra=True) +class TestADTrustInstall(ADTrustInstallTestBase): + """ + Tests built-in AD trust installation in various combinations (see the base + class for more details) against plain IPA master (no DNS, no KRA, no AD + trust) + """ + pass + + +class TestADTrustInstallWithDNS_KRA_ADTrust(ADTrustInstallTestBase): + """ + Tests built-in AD trust installation in various combinations (see the base + class for more details) against fully equipped (DNS, CA, KRA, ADtrust) + master. Additional two test cases were added to test interplay including + KRA installer + """ + + @classmethod + def install(cls, mh): + tasks.install_master(cls.master, setup_dns=True, setup_kra=True, + setup_adtrust=True) + + def test_replica1_all_components_adtrust(self): + self.install_replica(self.replicas[1], setup_ca=True, setup_kra=True) + + ## # Rest of master installation tests ##