2015-12-04 06:50:38 -06:00
|
|
|
#
|
2017-11-22 05:24:33 -06:00
|
|
|
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
|
2015-12-04 06:50:38 -06:00
|
|
|
#
|
|
|
|
|
|
|
|
import time
|
2016-08-12 06:14:10 -05:00
|
|
|
import pytest
|
|
|
|
from ipalib.constants import DOMAIN_LEVEL_0
|
2018-08-02 06:45:19 -05:00
|
|
|
from ipatests.pytest_ipa.integration.env_config import get_global_config
|
2015-12-04 06:50:38 -06:00
|
|
|
from ipatests.test_integration.base import IntegrationTest
|
2018-08-02 06:45:19 -05:00
|
|
|
from ipatests.pytest_ipa.integration import tasks
|
2015-12-04 06:50:38 -06:00
|
|
|
|
2016-08-12 06:14:10 -05:00
|
|
|
config = get_global_config()
|
2015-12-04 06:50:38 -06:00
|
|
|
|
|
|
|
class LayoutsBaseTest(IntegrationTest):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def install(cls, mh):
|
|
|
|
# tests use custom installation
|
|
|
|
pass
|
|
|
|
|
|
|
|
def replication_is_working(self):
|
|
|
|
test_user = 'replication-testuser'
|
|
|
|
self.master.run_command(
|
|
|
|
['ipa', 'user-add', test_user, '--first', 'test', '--last', 'user']
|
|
|
|
)
|
|
|
|
|
|
|
|
time.sleep(60) # make sure the replication of user is done
|
|
|
|
|
|
|
|
for r in self.replicas:
|
|
|
|
r.run_command(['ipa', 'user-show', test_user])
|
|
|
|
|
|
|
|
|
2016-08-12 06:14:10 -05:00
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
2015-12-04 06:50:38 -06:00
|
|
|
class TestLineTopologyWithoutCA(LayoutsBaseTest):
|
|
|
|
|
|
|
|
num_replicas = 3
|
|
|
|
|
|
|
|
def test_line_topology_without_ca(self):
|
|
|
|
tasks.install_topo('line', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=False)
|
|
|
|
self.replication_is_working()
|
|
|
|
|
|
|
|
|
|
|
|
class TestLineTopologyWithCA(LayoutsBaseTest):
|
|
|
|
|
|
|
|
num_replicas = 3
|
|
|
|
|
|
|
|
def test_line_topology_with_ca(self):
|
|
|
|
tasks.install_topo('line', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=True)
|
|
|
|
self.replication_is_working()
|
|
|
|
|
|
|
|
|
2016-10-04 16:08:19 -05:00
|
|
|
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()
|
|
|
|
|
|
|
|
|
2015-12-04 06:50:38 -06:00
|
|
|
class TestStarTopologyWithoutCA(LayoutsBaseTest):
|
|
|
|
|
|
|
|
num_replicas = 3
|
|
|
|
|
|
|
|
def test_star_topology_without_ca(self):
|
|
|
|
tasks.install_topo('star', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=False)
|
|
|
|
self.replication_is_working()
|
|
|
|
|
|
|
|
|
|
|
|
class TestStarTopologyWithCA(LayoutsBaseTest):
|
|
|
|
|
|
|
|
num_replicas = 3
|
|
|
|
|
|
|
|
def test_star_topology_with_ca(self):
|
|
|
|
tasks.install_topo('star', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=True)
|
|
|
|
self.replication_is_working()
|
|
|
|
|
|
|
|
|
2016-10-04 16:08:19 -05:00
|
|
|
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()
|
|
|
|
|
|
|
|
|
2015-12-04 06:50:38 -06:00
|
|
|
class TestCompleteTopologyWithoutCA(LayoutsBaseTest):
|
|
|
|
|
|
|
|
num_replicas = 3
|
|
|
|
|
|
|
|
def test_complete_topology_without_ca(self):
|
|
|
|
tasks.install_topo('complete', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=False)
|
|
|
|
self.replication_is_working()
|
|
|
|
|
|
|
|
|
|
|
|
class TestCompleteTopologyWithCA(LayoutsBaseTest):
|
|
|
|
|
|
|
|
num_replicas = 3
|
|
|
|
|
|
|
|
def test_complete_topology_with_ca(self):
|
|
|
|
tasks.install_topo('complete', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=True)
|
|
|
|
self.replication_is_working()
|
2016-02-09 10:12:00 -06:00
|
|
|
|
|
|
|
|
2016-10-04 16:08:19 -05:00
|
|
|
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()
|
|
|
|
|
|
|
|
|
2016-08-12 06:14:10 -05:00
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
2016-02-09 10:12:00 -06:00
|
|
|
class Test2ConnectedTopologyWithoutCA(LayoutsBaseTest):
|
|
|
|
num_replicas = 33
|
|
|
|
|
|
|
|
def test_2_connected_topology_without_ca(self):
|
|
|
|
tasks.install_topo('2-connected', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=False)
|
|
|
|
self.replication_is_working()
|
|
|
|
|
|
|
|
|
|
|
|
class Test2ConnectedTopologyWithCA(LayoutsBaseTest):
|
|
|
|
num_replicas = 33
|
|
|
|
|
|
|
|
def test_2_connected_topology_with_ca(self):
|
|
|
|
tasks.install_topo('2-connected', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=True)
|
|
|
|
self.replication_is_working()
|
2016-02-10 09:17:41 -06:00
|
|
|
|
|
|
|
|
2016-10-04 16:08:19 -05:00
|
|
|
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()
|
|
|
|
|
|
|
|
|
2016-08-12 06:14:10 -05:00
|
|
|
@pytest.mark.skipif(config.domain_level == DOMAIN_LEVEL_0,
|
|
|
|
reason='does not work on DOMAIN_LEVEL_0 by design')
|
2016-02-10 09:17:41 -06:00
|
|
|
class TestDoubleCircleTopologyWithoutCA(LayoutsBaseTest):
|
|
|
|
num_replicas = 29
|
|
|
|
|
|
|
|
def test_2_connected_topology_with_ca(self):
|
|
|
|
tasks.install_topo('double-circle', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=False)
|
|
|
|
self.replication_is_working()
|
|
|
|
|
|
|
|
|
|
|
|
class TestDoubleCircleTopologyWithCA(LayoutsBaseTest):
|
|
|
|
num_replicas = 29
|
|
|
|
|
|
|
|
def test_2_connected_topology_with_ca(self):
|
|
|
|
tasks.install_topo('double-circle', self.master, self.replicas, [],
|
|
|
|
setup_replica_cas=True)
|
|
|
|
self.replication_is_working()
|
2016-10-04 16:08:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
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()
|