Re: [Freeipa-devel] [Test][patch-0061] Fixed error in teardown method of replica_promotion tests

2016-08-30 Thread Martin Basti



On 24.08.2016 16:26, Oleg Fayans wrote:





ACK

Pushed to master: 5812af84a4a12528e969f14017e9675160b3faef

-- 
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

Re: [Freeipa-devel] [Test][patch-0061] Fixed error in teardown method of replica_promotion tests

2016-08-30 Thread Oleg Fayans
Bump for review. Other tests depend on this fix too, like 
replication_layouts_domainlevel_1


On 08/24/2016 04:26 PM, Oleg Fayans wrote:






--
Oleg Fayans
Quality Engineer
FreeIPA team
RedHat.

--
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


[Freeipa-devel] [Test][patch-0061] Fixed error in teardown method of replica_promotion tests

2016-08-24 Thread Oleg Fayans


--
Oleg Fayans
Quality Engineer
FreeIPA team
RedHat.
From 9b5163fcd60cc4d7ebe8ce573e0917d077e38faa Mon Sep 17 00:00:00 2001
From: Oleg Fayans 
Date: Wed, 24 Aug 2016 16:22:01 +0200
Subject: [PATCH] Disabled raiseonerr in kinit call during topology level check

domainlevel method is called upon each master uninstallation. Sometimes the
master uninstallation is called from within teardown method of some tests when
the master was not in fact installed, in which case the kinit_admin would
always raise an error.

https://fedorahosted.org/freeipa/ticket/6254
---
 ipatests/test_integration/tasks.py | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 21f5d9a96a533586f611975d195c8990f5cb7cc4..79adc2337c29e0db30f0d81736258bf7373290a0 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -299,9 +299,16 @@ def get_replica_filename(replica):
 
 
 def domainlevel(host):
-# Dynamically determines the domainlevel on master. Needed for scenarios
-# when domainlevel is changed during the test execution.
-kinit_admin(host)
+"""
+Dynamically determines the domainlevel on master. Needed for scenarios
+when domainlevel is changed during the test execution.
+
+Sometimes the master is even not installed. Please refer to ca-less
+tests, where we call tasks.uninstall_master after every test while a lot
+of them make sure that the server installation fails. Therefore we need
+to not raise on failures here.
+"""
+kinit_admin(host, raiseonerr=False)
 result = host.run_command(['ipa', 'domainlevel-get'], raiseonerr=False)
 level = 0
 domlevel_re = re.compile('.*(\d)')
@@ -651,8 +658,8 @@ def disconnect_replica(master, replica, domain_level=None):
 ])
 
 
-def kinit_admin(host):
-host.run_command(['kinit', 'admin'],
+def kinit_admin(host, raiseonerr=True):
+host.run_command(['kinit', 'admin'], raiseonerr=raiseonerr,
  stdin_text=host.config.admin_password)
 
 
-- 
1.8.3.1

-- 
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