-- Oleg Fayans Quality Engineer FreeIPA team RedHat.
From 9b5163fcd60cc4d7ebe8ce573e0917d077e38faa Mon Sep 17 00:00:00 2001 From: Oleg Fayans <ofay...@redhat.com> 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) -- 126.96.36.199
-- 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