mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
parent
1f1c93d2b5
commit
22b0e8a9eb
@ -1195,7 +1195,7 @@ def run_server_del(host, server_to_delete, force=False,
|
|||||||
def assert_error(result, stderr_text, returncode=None):
|
def assert_error(result, stderr_text, returncode=None):
|
||||||
"Assert that `result` command failed and its stderr contains `stderr_text`"
|
"Assert that `result` command failed and its stderr contains `stderr_text`"
|
||||||
assert stderr_text in result.stderr_text, result.stderr_text
|
assert stderr_text in result.stderr_text, result.stderr_text
|
||||||
if returncode:
|
if returncode is not None:
|
||||||
assert result.returncode == returncode
|
assert result.returncode == returncode
|
||||||
else:
|
else:
|
||||||
assert result.returncode > 0
|
assert result.returncode > 0
|
||||||
|
@ -348,10 +348,12 @@ class TestProhibitReplicaUninstallation(IntegrationTest):
|
|||||||
result = self.replicas[0].run_command(['ipa-server-install',
|
result = self.replicas[0].run_command(['ipa-server-install',
|
||||||
'--uninstall', '-U'],
|
'--uninstall', '-U'],
|
||||||
raiseonerr=False)
|
raiseonerr=False)
|
||||||
assert(result.returncode > 0), ("The replica was removed without "
|
# Due to ticket 3230 server installation/uninstallation always returns
|
||||||
"'--ignore-topology-disconnect' option")
|
# 0 unless an uncaught exception occurs. Once this issue is properly
|
||||||
assert("Uninstallation leads to disconnected topology"
|
# addressed, please care to change expected return code in the
|
||||||
in result.stdout_text), ("Expected error message was not found")
|
# 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',
|
self.replicas[0].run_command(['ipa-server-install', '--uninstall',
|
||||||
'-U', '--ignore-topology-disconnect'])
|
'-U', '--ignore-topology-disconnect'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user