From 84ca1fc220c329b58fb6a22c8eb9bf17d3622c55 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Tue, 4 Oct 2016 23:08:19 +0200 Subject: 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 --- ipatests/test_integration/tasks.py | 18 ++++++-- .../test_integration/test_replication_layouts.py | 48 ++++++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) (limited to 'ipatests') diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index 0b460b952..ef5078b87 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -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) diff --git a/ipatests/test_integration/test_replication_layouts.py b/ipatests/test_integration/test_replication_layouts.py index c17881530..53cae7d3d 100644 --- a/ipatests/test_integration/test_replication_layouts.py +++ b/ipatests/test_integration/test_replication_layouts.py @@ -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() -- cgit