Provide basic integration tests for built-in AD trust installer

A couple of tests were added to server/replica install integration
suite to test AD trust install w/ various combinations of other optional
components.

https://fedorahosted.org/freeipa/ticket/6630

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Martin Babinsky 2017-02-20 15:17:11 +01:00 committed by Martin Basti
parent 23cebe1356
commit 612ea7f66e
2 changed files with 59 additions and 5 deletions

View File

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

View File

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