From 2c05e42af6a8c7bccc1726bf05cf14be451a08fc Mon Sep 17 00:00:00 2001 From: Felipe Barreto Date: Thu, 1 Mar 2018 19:19:05 -0300 Subject: [PATCH] Fixing cleanup process in test_caless After commit bbe615e12c278f9cddaeb38e80b970bf14d9b32d, if the uninstall process fails (in the test cleanup) the error is not hidden anymore. That brought light to errors in the cleanup process on TestReplicaInstall test, like this: ``` RUN ['ipa-server-install', '--uninstall', '-U'] ipapython.admintool: ERROR Server removal aborted: Replication topology in suffix 'domain' is disconnected: Topology does not allow server master.ipa.test to replicate with servers: replica0.ipa.test. ipapython.admintool: ERROR The ipa-server-install command failed ``` This commit changes the order of how a replica should be removed from the topology. Reviewed-By: Petr Vobornik Reviewed-By: Christian Heimes --- ipatests/test_integration/test_caless.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py index b17de6fd0..eb2a36bc4 100644 --- a/ipatests/test_integration/test_caless.py +++ b/ipatests/test_integration/test_caless.py @@ -105,15 +105,14 @@ def replica_install_teardown(func): replica = args[0].replicas[0] master = args[0].master tasks.kinit_admin(master) + tasks.clean_replication_agreement(master, replica, cleanup=True, + raiseonerr=False) + master.run_command(['ipa', 'host-del', replica.hostname], + raiseonerr=False) tasks.uninstall_master(replica, clean=False) # Now let's uninstall client for the cases when client promotion # was not successful tasks.uninstall_client(replica) - tasks.clean_replication_agreement(master, replica, cleanup=True, - raiseonerr=False) - master.run_command(['ipa', 'host-del', - replica.hostname], - raiseonerr=False) ipa_certs_cleanup(replica) return wrapped