Hello,
Patch 0328 fixes the problem that I filed [4038] for: CA-less tests fail when run in some setups on Beaker. What the ticket says was premature diagnosis; I'll close the ticket as invalid.
See commit message for the real problem.

Patch 0329 adds a bit more info to logs.


[4038] https://fedorahosted.org/freeipa/ticket/4038 tests: Forwarder is not set on replicas

--
PetrĀ³
From 5c3bb59c6c0a46e2841a95d643edf29692024e4e Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Thu, 24 Oct 2013 12:14:58 +0200
Subject: [PATCH] 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.
---
 ipatests/test_integration/config.py | 14 ++++++++++----
 ipatests/test_integration/host.py   |  9 ++++++---
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/ipatests/test_integration/config.py b/ipatests/test_integration/config.py
index 3aa4d05d6cb5758cd0d6be64a1ac582adcc971b4..b8c5fdc7f9ce1877e34491964418a8d806168e73 100644
--- a/ipatests/test_integration/config.py
+++ b/ipatests/test_integration/config.py
@@ -236,8 +236,10 @@ def env_normalize(env):
     """Fill env variables from alternate variable names
 
     MASTER_env1 <- MASTER
-    REPLICA_env1 <- REPLICA
-    CLIENT_env1 <- CLIENT, SLAVE
+    REPLICA_env1 <- REPLICA, SLAVE
+    CLIENT_env1 <- CLIENT
+    similarly for BEAKER* variants: BEAKERMASTER1_env1 <- BEAKERMASTER, etc.
+
     CLIENT_env1 gets extended with CLIENT2 or CLIENT2_env1
     """
     def coalesce(name, *other_names):
@@ -253,8 +255,12 @@ def coalesce(name, *other_names):
             else:
                 env[name] = ''
     coalesce('MASTER_env1', 'MASTER')
-    coalesce('REPLICA_env1', 'REPLICA')
-    coalesce('CLIENT_env1', 'CLIENT', 'SLAVE')
+    coalesce('REPLICA_env1', 'REPLICA', 'SLAVE')
+    coalesce('CLIENT_env1', 'CLIENT')
+
+    coalesce('BEAKERMASTER1_env1', 'BEAKERMASTER')
+    coalesce('BEAKERREPLICA1_env1', 'BEAKERREPLICA', 'BEAKERSLAVE')
+    coalesce('BEAKERCLIENT1_env1', 'BEAKERCLIENT')
 
     def extend(name, name2):
         value = env.get(name2)
diff --git a/ipatests/test_integration/host.py b/ipatests/test_integration/host.py
index 02c82b372ce2805c0ca922319f5de1cd29b0ed82..be45a0337a9fe15b3463e839b324daa1effdf8e6 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 @@ def __init__(self, domain, hostname, role, index, ip=None):
         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 @@ def remove_log_collector(self, collector):
     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 @@ def from_env(cls, env, domain, hostname, role, index):
         else:
             cls = Host
 
-        self = cls(domain, hostname, role, index, ip)
+        self = cls(domain, hostname, role, index, ip, external_hostname)
         return self
 
     @property
-- 
1.8.3.1

From 23cfbd130e08c87ac5804aad7e7a031a124cb8a5 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Thu, 21 Nov 2013 13:57:47 +0100
Subject: [PATCH] test_integration: Log external hostname in Host.ldap_connect

This may make debugging easier if the address is set incorrectly.
---
 ipatests/test_integration/host.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipatests/test_integration/host.py b/ipatests/test_integration/host.py
index be45a0337a9fe15b3463e839b324daa1effdf8e6..507e19ed62b3d0a76e6e2ff6286fd83f17a68627 100644
--- a/ipatests/test_integration/host.py
+++ b/ipatests/test_integration/host.py
@@ -160,7 +160,7 @@ def put_file_contents(self, filename, contents):
     def ldap_connect(self):
         """Return an LDAPClient authenticated to this host as directory manager
         """
-        self.log.info('Connecting to LDAP')
+        self.log.info('Connecting to LDAP at %s', self.external_hostname)
         ldap = IPAdmin(self.external_hostname)
         binddn = self.config.dirman_dn
         self.log.info('LDAP bind as %s' % binddn)
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to