Oleg Fayans
Quality Engineer
FreeIPA team
From 6650cc39b9704191d3099cf1780c477b2c0ef9af Mon Sep 17 00:00:00 2001
From: Oleg Fayans <ofay...@redhat.com>
Date: Tue, 22 Sep 2015 10:38:08 +0200
Subject: [PATCH] Added a proper workaround for dnssec test failures in Beaker

In beaker lab the situation when master and replica have ip addresses from
different subnets is quite frequent. When a replica has ip from different
subnet than master's, ipa-replica-prepare looks up a proper reverse zone to
add a pointer record, and if it does not find it, it asks a user for permission
to create it automatically. It breaks the tests adding the unexpected input.
The workaround is to always create a reverse zone for a new replica.

Corresponding ticket is https://fedorahosted.org/freeipa/ticket/5306
 ipatests/test_integration/tasks.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 06049d4ae01332e0af4d8775b745342406fc868d..c17e5e3fbacb85281eb63d7616531d7b2810a4ec 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -58,6 +58,14 @@ def check_arguments_are(slice, instanceof):
         return wrapped
     return wrapper
+def prepare_reverse_zone(host, ip):
+    nums = ip.split('.')[:-1]
+    zone = ".".join(reversed(nums)) + ".in-addr.arpa."
+    host.run_command(["ipa",
+                      "dnszone-add",
+                      zone,
+                      "--name-from-ip=%s" % ip], raiseonerr=False)
 def prepare_host(host):
     if isinstance(host, Host):
@@ -240,17 +248,17 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False):
+    prepare_reverse_zone(master, replica.ip)
                         '-p', replica.config.dirman_password,
-                        '--ip-address', replica.ip, '--no-reverse',
+                        '--ip-address', replica.ip,
     replica_bundle = master.get_file_contents(
         paths.REPLICA_INFO_GPG_TEMPLATE % replica.hostname)
     replica_filename = os.path.join(replica.config.test_dir,
     replica.put_file_contents(replica_filename, replica_bundle)
-    args = ['ipa-replica-install', '-U', '--no-host-dns',
+    args = ['ipa-replica-install', '-U',
             '-p', replica.config.dirman_password,
             '-w', replica.config.admin_password,
             '--ip-address', replica.ip,

Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to