Hello,
Here are some fixes to our integration tests.

--
Petr³
From 90e34930cb0dc770ca7411196e8a8c75d339a6d9 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Thu, 31 Jul 2014 13:41:27 +0200
Subject: [PATCH] test_integration.tasks: Wait for DNS after adding A records
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

New records are not visible in DNS immediately after they are added.
When a replica is installed too soon, its record might still be missing
in DNS and the master→replica connection check would fail.

Add the wait_for_dns option to prevent this problem.
---
 ipatests/test_integration/tasks.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 4ed4662a03e666505c2ca3a74132362a122be7e4..5e8880888823d36e6acb421511aec37588b0eacc 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -710,6 +710,7 @@ def add_a_record(master, host):
     # If not, add it
     if cmd.returncode != 0:
         master.run_command(['ipa',
+                            '-e', 'wait_for_dns=30',
                             'dnsrecord-add',
                             master.domain.name,
                             host.hostname,
-- 
1.9.3

From 3cfc380c923023cedbd5a48c03519153f1c8ab1b Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Thu, 31 Jul 2014 14:59:19 +0200
Subject: [PATCH] test_integration.task: Add DNS A records when installing a
 master

Previously DNS records for hosts in the master's domain were
only added in install_topo, not in tests which install "manually".
Make the record adding an opt-out part of master installation.
---
 ipatests/ipa-test-task             | 6 +++++-
 ipatests/test_integration/tasks.py | 7 ++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ipatests/ipa-test-task b/ipatests/ipa-test-task
index 02a04b6ab3fabbefec0ea6b33e2d37b955e529f3..53a5241400f550dc35db3ccef9badadad2133a0d 100755
--- a/ipatests/ipa-test-task
+++ b/ipatests/ipa-test-task
@@ -84,6 +84,10 @@ class TaskRunner(object):
             help='Install IPA on the master')
         subparser.add_argument('--host', type=str,
                             help='Host to use (Default: from config)')
+        subparser.add_argument('--no-a-records', action='store_false',
+                               default=True,
+                               help='Do not create DNS A records for all '
+                                    'configured hosts')
         subparser.set_defaults(func=self.install_master)
 
         subparser = subparsers.add_parser(
@@ -318,7 +322,7 @@ class TaskRunner(object):
     def install_master(self, args):
         master = self.get_host(args.host, default=args.domain.master)
         log.info('Installing master %s', master.hostname)
-        tasks.install_master(master)
+        tasks.install_master(master, add_a_records=args.add_a_records)
 
     def install_replica(self, args):
         replica = self.get_host(args.replica)
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 5e8880888823d36e6acb421511aec37588b0eacc..741c9777268296ffc80c4f3b4d2ac91837330111 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -184,7 +184,7 @@ def enable_replication_debugging(host):
                      stdin_text=logging_ldif)
 
 
-def install_master(host):
+def install_master(host, add_a_records=True):
     host.collect_log(paths.IPASERVER_INSTALL_LOG)
     host.collect_log(paths.IPACLIENT_INSTALL_LOG)
     inst = host.domain.realm.replace('.', '-')
@@ -206,6 +206,9 @@ def install_master(host):
 
     kinit_admin(host)
 
+    if add_a_records:
+        add_a_records_for_hosts_in_master_domain(host)
+
 
 def install_replica(master, replica, setup_ca=True):
     replica.collect_log(paths.IPAREPLICA_INSTALL_LOG)
@@ -627,8 +630,6 @@ def install_topo(topo, master, replicas, clients,
     if not skip_master:
         install_master(master)
 
-    add_a_records_for_hosts_in_master_domain(master)
-
     for parent, child in get_topo(topo)(master, replicas):
         if child in installed:
             log.info('Connecting replica %s to %s' % (parent, child))
-- 
1.9.3

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

Reply via email to