From fd348773706b556bfe7660c31826b24b76c7f05e Mon Sep 17 00:00:00 2001 From: Ganna Kaihorodova Date: Fri, 22 Jun 2018 14:01:39 +0200 Subject: [PATCH] Add check for occuring traceback during uninstallation ipa master Modified master uninstall task for traceback check That approach give us wide coverage and multiple scenarious to catch traceback during uninstallation process Add verbose option to uninstall server and set to False Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1480502 Reviewed-By: Tibor Dudlak Reviewed-By: Petr Cech Reviewed-By: Rob Crittenden --- ipatests/pytest_plugins/integration/tasks.py | 9 +++++++-- ipatests/test_integration/test_server_del.py | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ipatests/pytest_plugins/integration/tasks.py b/ipatests/pytest_plugins/integration/tasks.py index 31e66bdae..a50b55d7d 100644 --- a/ipatests/pytest_plugins/integration/tasks.py +++ b/ipatests/pytest_plugins/integration/tasks.py @@ -738,7 +738,7 @@ def kinit_admin(host, raiseonerr=True): def uninstall_master(host, ignore_topology_disconnect=True, - ignore_last_of_role=True, clean=True): + ignore_last_of_role=True, clean=True, verbose=False): host.collect_log(paths.IPASERVER_UNINSTALL_LOG) uninstall_cmd = ['ipa-server-install', '--uninstall', '-U'] @@ -750,7 +750,12 @@ def uninstall_master(host, ignore_topology_disconnect=True, if ignore_last_of_role and host_domain_level != DOMAIN_LEVEL_0: uninstall_cmd.append('--ignore-last-of-role') - host.run_command(uninstall_cmd) + if verbose and host_domain_level != DOMAIN_LEVEL_0: + uninstall_cmd.append('-v') + + result = host.run_command(uninstall_cmd) + assert "Traceback" not in result.stdout_text + host.run_command(['pkidestroy', '-s', 'CA', '-i', 'pki-tomcat'], raiseonerr=False) host.run_command(['rm', '-rf', diff --git a/ipatests/test_integration/test_server_del.py b/ipatests/test_integration/test_server_del.py index c35bcb87d..1789561ca 100644 --- a/ipatests/test_integration/test_server_del.py +++ b/ipatests/test_integration/test_server_del.py @@ -185,7 +185,7 @@ class TestServerDel(ServerDelBase): def test_ignore_topology_disconnect_replica2(self): """ tests that removal of replica2 with '--ignore-topology-disconnect' - destroys master for good + destroys master for good with verbose option for uninstallation """ check_master_removal( self.client, @@ -194,7 +194,7 @@ class TestServerDel(ServerDelBase): ) # reinstall the replica - tasks.uninstall_master(self.replica2) + tasks.uninstall_master(self.replica2, verbose=True) tasks.install_replica(self.master, self.replica2, setup_ca=True) def test_removal_of_master_disconnects_both_topologies(self):