CI: extend replication layouts tests with KRA

KRA should be tested with warious replication topologies as well, mainly
in domain level 0

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

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
This commit is contained in:
Martin Basti 2016-10-04 23:08:19 +02:00
parent dc873007f8
commit 84ca1fc220
2 changed files with 63 additions and 3 deletions

View File

@ -994,12 +994,20 @@ def double_circle_topo(master, replicas, site_size=6):
def install_topo(topo, master, replicas, clients, domain_level=None,
skip_master=False, setup_replica_cas=True):
skip_master=False, setup_replica_cas=True,
setup_replica_kras=False):
"""Install IPA servers and clients in the given topology"""
if setup_replica_kras and not setup_replica_cas:
raise ValueError("Option 'setup_replica_kras' requires "
"'setup_replica_cas' set to True")
replicas = list(replicas)
installed = {master}
if not skip_master:
install_master(master, domain_level=domain_level)
install_master(
master,
domain_level=domain_level,
setup_kra=setup_replica_kras
)
add_a_records_for_hosts_in_master_domain(master)
@ -1009,7 +1017,11 @@ def install_topo(topo, master, replicas, clients, domain_level=None,
connect_replica(parent, child)
else:
log.info('Installing replica %s from %s' % (parent, child))
install_replica(parent, child, setup_ca=setup_replica_cas)
install_replica(
parent, child,
setup_ca=setup_replica_cas,
setup_kra=setup_replica_kras
)
installed.add(child)
install_clients([master] + replicas, clients)

View File

@ -52,6 +52,16 @@ class TestLineTopologyWithCA(LayoutsBaseTest):
self.replication_is_working()
class TestLineTopologyWithCAKRA(LayoutsBaseTest):
num_replicas = 3
def test_line_topology_with_ca_kra(self):
tasks.install_topo('line', self.master, self.replicas, [],
setup_replica_cas=True, setup_replica_kras=True)
self.replication_is_working()
class TestStarTopologyWithoutCA(LayoutsBaseTest):
num_replicas = 3
@ -72,6 +82,16 @@ class TestStarTopologyWithCA(LayoutsBaseTest):
self.replication_is_working()
class TestStarTopologyWithCAKRA(LayoutsBaseTest):
num_replicas = 3
def test_star_topology_with_ca_kra(self):
tasks.install_topo('star', self.master, self.replicas, [],
setup_replica_cas=True, setup_replica_kras=True)
self.replication_is_working()
class TestCompleteTopologyWithoutCA(LayoutsBaseTest):
num_replicas = 3
@ -92,6 +112,16 @@ class TestCompleteTopologyWithCA(LayoutsBaseTest):
self.replication_is_working()
class TestCompleteTopologyWithCAKRA(LayoutsBaseTest):
num_replicas = 3
def test_complete_topology_with_ca_kra(self):
tasks.install_topo('complete', self.master, self.replicas, [],
setup_replica_cas=True, setup_replica_kras=True)
self.replication_is_working()
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
reason='does not work on DOMAIN_LEVEL_0 by design')
class Test2ConnectedTopologyWithoutCA(LayoutsBaseTest):
@ -112,6 +142,15 @@ class Test2ConnectedTopologyWithCA(LayoutsBaseTest):
self.replication_is_working()
class Test2ConnectedTopologyWithCAKRA(LayoutsBaseTest):
num_replicas = 33
def test_2_connected_topology_with_ca_kra(self):
tasks.install_topo('2-connected', self.master, self.replicas, [],
setup_replica_cas=True, setup_replica_kras=True)
self.replication_is_working()
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
reason='does not work on DOMAIN_LEVEL_0 by design')
class TestDoubleCircleTopologyWithoutCA(LayoutsBaseTest):
@ -130,3 +169,12 @@ class TestDoubleCircleTopologyWithCA(LayoutsBaseTest):
tasks.install_topo('double-circle', self.master, self.replicas, [],
setup_replica_cas=True)
self.replication_is_working()
class TestDoubleCircleTopologyWithCAKRA(LayoutsBaseTest):
num_replicas = 29
def test_2_connected_topology_with_ca_kra(self):
tasks.install_topo('double-circle', self.master, self.replicas, [],
setup_replica_cas=True, setup_replica_kras=True)
self.replication_is_working()