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 <tdudlak@redhat.com>
Reviewed-By: Petr Cech <pcech@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Ganna Kaihorodova 2018-06-22 14:01:39 +02:00 committed by Rob Crittenden
parent f3faecbbb4
commit fd34877370
2 changed files with 9 additions and 4 deletions

View File

@ -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',

View File

@ -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):