summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorOleg Fayans <ofayans@redhat.com>2016-03-08 12:29:35 +0100
committerMartin Basti <mbasti@redhat.com>2016-03-11 17:27:45 +0100
commitddadbf8274608ad93bf95c7c311c675261b909b8 (patch)
tree855d04250e7076096b12e594e06312600b3eed01 /ipatests
parent0b1fe08f1d83f0cb25262da8b46e7d4cab8cf31b (diff)
downloadfreeipa-ddadbf8274608ad93bf95c7c311c675261b909b8.tar.gz
freeipa-ddadbf8274608ad93bf95c7c311c675261b909b8.tar.xz
freeipa-ddadbf8274608ad93bf95c7c311c675261b909b8.zip
Enabled setting domain level explicitly in test class
Needed for replica promotion tests https://fedorahosted.org/freeipa/ticket/5723 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_integration/base.py8
-rw-r--r--ipatests/test_integration/tasks.py17
2 files changed, 18 insertions, 7 deletions
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)