summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-12-11 18:15:48 +0100
committerPetr Viktorin <pviktori@redhat.com>2014-03-05 10:00:57 +0100
commit56f0430f522f2d4dfd0d8a120cfbc04424d6b648 (patch)
treed1574184f9b0b5ff11fd3a733c9feba1dd972d23 /ipatests
parent9b540ef21864f8da822bd92d58385339147e773d (diff)
downloadfreeipa-56f0430f522f2d4dfd0d8a120cfbc04424d6b648.tar.gz
freeipa-56f0430f522f2d4dfd0d8a120cfbc04424d6b648.tar.xz
freeipa-56f0430f522f2d4dfd0d8a120cfbc04424d6b648.zip
test_integration.config: Fix crash in to_env when no replica is defined
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_integration/config.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/ipatests/test_integration/config.py b/ipatests/test_integration/config.py
index b8c5fdc7f..1c2b6a50d 100644
--- a/ipatests/test_integration/config.py
+++ b/ipatests/test_integration/config.py
@@ -29,6 +29,8 @@ from ipapython.dn import DN
from ipapython.ipa_log_manager import log_mgr
from ipatests.test_integration.host import BaseHost, Host
+TESTHOST_PREFIX = 'TESTHOST_'
+
class Config(object):
def __init__(self, **kwargs):
@@ -181,8 +183,11 @@ class Config(object):
for role in domain.roles:
hosts = domain.hosts_by_role(role)
+ prefix = ('' if role in domain.static_roles
+ else TESTHOST_PREFIX)
+
hostnames = ' '.join(h.hostname for h in hosts)
- env['%s%s' % (role.upper(), domain._env)] = hostnames
+ env['%s%s%s' % (prefix, role.upper(), domain._env)] = hostnames
ext_hostnames = ' '.join(h.external_hostname for h in hosts)
env['BEAKER%s%s' % (role.upper(), domain._env)] = ext_hostnames
@@ -209,9 +214,10 @@ class Config(object):
env['MASTER'] = default_domain.master.hostname
env['BEAKERMASTER'] = default_domain.master.external_hostname
env['MASTERIP'] = default_domain.master.ip
- env['SLAVE'] = env['REPLICA'] = env['REPLICA_env1']
- env['BEAKERSLAVE'] = env['BEAKERREPLICA_env1']
- env['SLAVEIP'] = env['BEAKERREPLICA_IP_env1']
+ if default_domain.replicas:
+ env['SLAVE'] = env['REPLICA'] = env['REPLICA_env1']
+ env['BEAKERSLAVE'] = env['BEAKERREPLICA_env1']
+ env['SLAVEIP'] = env['BEAKERREPLICA_IP_env1']
if default_domain.clients:
client = default_domain.clients[0]
env['CLIENT'] = client.hostname