On 12/07/2015 01:53 PM, Martin Babinsky wrote:
On 12/07/2015 12:07 PM, Oleg Fayans wrote:
Hi Martin,

CONFIGURED_DOMAIN_LEVEL is declared, but not used. The rest looks fine
to me

On 12/07/2015 11:05 AM, Martin Babinsky wrote:
This patch should fix teardown methods in replication-related CI tests
ran at non-zero domain level.




Ah that was a leftover from previous implementation. Here's updated patch.



Patch needed a rebase. Attaching new revision.

--
Martin^3 Babinsky
From bf1659f9ff03983740a1e786c78568b7851e7a02 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Fri, 4 Dec 2015 18:24:31 +0100
Subject: [PATCH] CI tests: ignore disconnected domain level 1 topology on IPA
 master teardown

---
 ipatests/test_integration/tasks.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index ddbb5af29ce7b36fe178294f45a72cf941730918..c3681fca952807ac6ebcca56ce961df2d3f33f0c 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -343,7 +343,7 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False,
             '--setup-dns',
             '--forwarder', replica.config.dns_forwarder
         ])
-    if domainlevel(master) == 0:
+    if domainlevel(master) == DOMAIN_LEVEL_0:
         apply_common_fixes(replica)
         # prepare the replica file on master and put it to replica, AKA "old way"
         replica_prepare(master, replica)
@@ -365,7 +365,7 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False,
             "-p", replica.config.dirman_password,
             "-U",
         ]
-        if domainlevel(master) == 0:
+        if domainlevel(master) == DOMAIN_LEVEL_0:
             args.append(replica_filename)
         replica.run_command(args)
 
@@ -615,11 +615,16 @@ def kinit_admin(host):
                      stdin_text=host.config.admin_password)
 
 
-def uninstall_master(host):
+def uninstall_master(host, ignore_topology_disconnect=True):
     host.collect_log(paths.IPASERVER_UNINSTALL_LOG)
+    uninstall_cmd = ['ipa-server-install', '--uninstall', '-U']
 
-    host.run_command(['ipa-server-install', '--uninstall', '-U'],
-                     raiseonerr=False)
+    host_domain_level = domainlevel(host)
+
+    if ignore_topology_disconnect and host_domain_level != DOMAIN_LEVEL_0:
+        uninstall_cmd.append('--ignore-topology-disconnect')
+
+    host.run_command(uninstall_cmd, raiseonerr=False)
     host.run_command(['pkidestroy', '-s', 'CA', '-i', 'pki-tomcat'],
                      raiseonerr=False)
     host.run_command(['rm', '-rf',
-- 
2.5.0

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

Reply via email to