summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration/host.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-10-24 12:14:58 +0200
committerMartin Kosek <mkosek@redhat.com>2013-12-06 12:58:50 +0100
commit98f4c22267491bb8adceddcbd7ac4865b737e70f (patch)
tree0fb454d1c0dd14359e6f82dedff48278ffbd7df1 /ipatests/test_integration/host.py
parentaf26e6da4650b3a429af31bc38b546eff27e38c6 (diff)
downloadfreeipa-98f4c22267491bb8adceddcbd7ac4865b737e70f.tar.gz
freeipa-98f4c22267491bb8adceddcbd7ac4865b737e70f.tar.xz
freeipa-98f4c22267491bb8adceddcbd7ac4865b737e70f.zip
test_integration: Support external names for hosts
The framework had a concept of external hostnames, which the controller uses to contact the test machines, but they were not loaded from configuration. Load external names from configuration. This makes tests pass in setups where internal and external hostnames are different, and the internal hostnames are not initially resolvable from the controller.
Diffstat (limited to 'ipatests/test_integration/host.py')
-rw-r--r--ipatests/test_integration/host.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ipatests/test_integration/host.py b/ipatests/test_integration/host.py
index 02c82b372..be45a0337 100644
--- a/ipatests/test_integration/host.py
+++ b/ipatests/test_integration/host.py
@@ -32,7 +32,8 @@ class BaseHost(object):
"""Representation of a remote IPA host"""
transport_class = None
- def __init__(self, domain, hostname, role, index, ip=None):
+ def __init__(self, domain, hostname, role, index, ip=None,
+ external_hostname=None):
self.domain = domain
self.role = role
self.index = index
@@ -40,7 +41,7 @@ class BaseHost(object):
shortname, dot, ext_domain = hostname.partition('.')
self.shortname = shortname
self.hostname = shortname + '.' + self.domain.name
- self.external_hostname = hostname
+ self.external_hostname = external_hostname or hostname
self.netbios = self.domain.name.split('.')[0].upper()
@@ -96,6 +97,8 @@ class BaseHost(object):
def from_env(cls, env, domain, hostname, role, index):
ip = env.get('BEAKER%s%s_IP_env%s' %
(role.upper(), index, domain.index), None)
+ external_hostname = env.get(
+ 'BEAKER%s%s_env%s' % (role.upper(), index, domain.index), None)
# We need to determine the type of the host, this depends on the domain
# type, as we assume all Unix machines are in the Unix domain and
@@ -106,7 +109,7 @@ class BaseHost(object):
else:
cls = Host
- self = cls(domain, hostname, role, index, ip)
+ self = cls(domain, hostname, role, index, ip, external_hostname)
return self
@property