summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorOleg Fayans <ofayans@redhat.com>2016-09-02 15:24:40 +0200
committerMartin Basti <mbasti@redhat.com>2016-09-14 09:46:22 +0200
commit22b0e8a9eb9eb3d47131c6784d70dd409d5b889b (patch)
treecdd06aeda85fd4ff5dbf80f86c064bbcc687ea64 /ipatests
parent1f1c93d2b5023f8d491252c605dbcf05c8ecc7e3 (diff)
Removed incorrect check for returncode
The server installation in most cases returns response code 0 no matter what happens except for really severe errors. In this case when we try to uninstall the middle replica of a line topology, it fails, notifies us that we should use '--ignore-topology-disconnect', but returns 0 https://fedorahosted.org/freeipa/ticket/6300 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_integration/tasks.py2
-rw-r--r--ipatests/test_integration/test_replica_promotion.py10
2 files changed, 7 insertions, 5 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 677e5cf74..ee9d4a210 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -1195,7 +1195,7 @@ def run_server_del(host, server_to_delete, force=False,
def assert_error(result, stderr_text, returncode=None):
"Assert that `result` command failed and its stderr contains `stderr_text`"
assert stderr_text in result.stderr_text, result.stderr_text
- if returncode:
+ if returncode is not None:
assert result.returncode == returncode
else:
assert result.returncode > 0
diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py
index 3e62f9252..e06cafd11 100644
--- a/ipatests/test_integration/test_replica_promotion.py
+++ b/ipatests/test_integration/test_replica_promotion.py
@@ -348,10 +348,12 @@ class TestProhibitReplicaUninstallation(IntegrationTest):
result = self.replicas[0].run_command(['ipa-server-install',
'--uninstall', '-U'],
raiseonerr=False)
- assert(result.returncode > 0), ("The replica was removed without "
- "'--ignore-topology-disconnect' option")
- assert("Uninstallation leads to disconnected topology"
- in result.stdout_text), ("Expected error message was not found")
+ # Due to ticket 3230 server installation/uninstallation always returns
+ # 0 unless an uncaught exception occurs. Once this issue is properly
+ # addressed, please care to change expected return code in the
+ # following assert from 0 to something else.
+ assert_error(result, "Removal of '%s' leads to disconnected"
+ " topology" % self.replicas[0].hostname, 0)
self.replicas[0].run_command(['ipa-server-install', '--uninstall',
'-U', '--ignore-topology-disconnect'])