From ddadbf8274608ad93bf95c7c311c675261b909b8 Mon Sep 17 00:00:00 2001 From: Oleg Fayans Date: Tue, 8 Mar 2016 12:29:35 +0100 Subject: Enabled setting domain level explicitly in test class Needed for replica promotion tests https://fedorahosted.org/freeipa/ticket/5723 Reviewed-By: Martin Basti --- ipatests/test_integration/base.py | 8 +++++++- ipatests/test_integration/tasks.py | 17 +++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'ipatests') diff --git a/ipatests/test_integration/base.py b/ipatests/test_integration/base.py index 4f57e9590..ee2716799 100644 --- a/ipatests/test_integration/base.py +++ b/ipatests/test_integration/base.py @@ -37,6 +37,7 @@ class IntegrationTest(object): num_ad_domains = 0 required_extra_roles = [] topology = None + domain_level = None @classmethod def setup_class(cls): @@ -62,11 +63,16 @@ class IntegrationTest(object): @classmethod def install(cls, mh): + if cls.domain_level is not None: + domain_level = cls.domain_level + else: + domain_level = cls.master.config.domain_level if cls.topology is None: return else: tasks.install_topo(cls.topology, - cls.master, cls.replicas, cls.clients) + cls.master, cls.replicas, + cls.clients, domain_level) @classmethod def teardown_class(cls): pass diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index cb9620133..3428a065b 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -224,7 +224,10 @@ def enable_replication_debugging(host): stdin_text=logging_ldif) -def install_master(host, setup_dns=True, setup_kra=False, extra_args=()): +def install_master(host, setup_dns=True, setup_kra=False, extra_args=(), + domain_level=None): + if domain_level is None: + domain_level = host.config.domain_level host.collect_log(paths.IPASERVER_INSTALL_LOG) host.collect_log(paths.IPACLIENT_INSTALL_LOG) inst = host.domain.realm.replace('.', '-') @@ -240,7 +243,7 @@ def install_master(host, setup_dns=True, setup_kra=False, extra_args=()): '-r', host.domain.realm, '-p', host.config.dirman_password, '-a', host.config.admin_password, - "--domain-level=%i" % host.config.domain_level + "--domain-level=%i" % domain_level, ] if setup_dns: @@ -309,7 +312,9 @@ def replica_prepare(master, replica): def install_replica(master, replica, setup_ca=True, setup_dns=False, - setup_kra=False, extra_args=()): + setup_kra=False, extra_args=(), domain_level=None): + if domain_level is None: + domain_level = domainlevel(master) replica.collect_log(paths.IPAREPLICA_INSTALL_LOG) replica.collect_log(paths.IPAREPLICA_CONNCHECK_LOG) allow_sync_ptr(master) @@ -330,7 +335,7 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False, args.extend(extra_args) - if domainlevel(master) == DOMAIN_LEVEL_0: + if domain_level == DOMAIN_LEVEL_0: # prepare the replica file on master and put it to replica, AKA "old way" replica_prepare(master, replica) replica_filename = get_replica_filename(replica) @@ -976,13 +981,13 @@ def double_circle_topo(master, replicas, site_size=6): yield site[1], site_servers[-1] -def install_topo(topo, master, replicas, clients, +def install_topo(topo, master, replicas, clients, domain_level=None, skip_master=False, setup_replica_cas=True): """Install IPA servers and clients in the given topology""" replicas = list(replicas) installed = {master} if not skip_master: - install_master(master) + install_master(master, domain_level=domain_level) add_a_records_for_hosts_in_master_domain(master) -- cgit