summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration/config.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-07-10 16:24:26 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-07-15 15:49:16 +0200
commit23d3fde05960d6e47485e246e11bec701b30cb59 (patch)
treec3790f3e75beb637fc07e2c14eae66ef3d7b3685 /ipatests/test_integration/config.py
parent0db6fb9ec51f7cd1b4fc29a5e1a13cd3fe7657e1 (diff)
downloadfreeipa-23d3fde05960d6e47485e246e11bec701b30cb59.tar.gz
freeipa-23d3fde05960d6e47485e246e11bec701b30cb59.tar.xz
freeipa-23d3fde05960d6e47485e246e11bec701b30cb59.zip
Integration test config: Make it possible to specify host IP
Diffstat (limited to 'ipatests/test_integration/config.py')
-rw-r--r--ipatests/test_integration/config.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/ipatests/test_integration/config.py b/ipatests/test_integration/config.py
index adc39965c..d43812c51 100644
--- a/ipatests/test_integration/config.py
+++ b/ipatests/test_integration/config.py
@@ -85,6 +85,8 @@ class Config(object):
CLIENT_env1: space-separated FQDNs of the clients
OTHER_env1: space-separated FQDNs of other hosts
(same for _env2, _env3, etc)
+ BEAKERREPLICA1_IP_env1: IP address of replica 1 in env 1
+ (same for MASTER, CLIENT)
Also see env_normalize() for alternate variable names
"""
@@ -165,9 +167,10 @@ class Config(object):
# tests. This means no _env<NUM> suffix.
if self.domains:
default_domain = self.domains[0]
- env['MASTER'] = default_domain.master.hostname
- env['BEAKERMASTER'] = default_domain.master.external_hostname
- env['MASTERIP'] = default_domain.master.ip
+ if default_domain.master:
+ 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']
@@ -258,8 +261,8 @@ class Domain(object):
for role in 'master', 'replica', 'client', 'other':
value = env.get('%s%s' % (role.upper(), self._env), '')
- for hostname in value.split():
- host = Host.from_env(env, self, hostname, role, 1)
+ for index, hostname in enumerate(value.split(), start=1):
+ host = Host.from_env(env, self, hostname, role, index)
self.hosts.append(host)
if not self.hosts:
@@ -300,7 +303,7 @@ class Domain(object):
def host_by_name(self, name):
for host in self.hosts:
- if host.hostname == name or host.external_hostname == name:
+ if name in (host.hostname, host.external_hostname, host.shortname):
return host
raise LookupError(name)