diff options
author | Martin Schwenke <martin@meltin.net> | 2020-07-06 11:56:16 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2020-07-22 07:53:36 +0000 |
commit | a766136df459df33becd05726253b83d32993a94 (patch) | |
tree | 55aba960ca741da823b709667b886f496956891e | |
parent | a369bedf8c5eee75748cdbd6a1a900ca9ac4da9e (diff) | |
download | samba-a766136df459df33becd05726253b83d32993a94.tar.gz |
ctdb-tests: Do not trigger ctdb_test_error() from ctdb_init()
The only caller calls ctdb_test_error() on failure and nesting this
calls can be confusing. A future change will make this even more
confusing.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index 76d4d6c4b06..61372a44b60 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -583,9 +583,15 @@ ctdb_init () { ctdb_nodes_stop >/dev/null 2>&1 || : - ctdb_nodes_start || ctdb_test_error "Cluster start failed" + if ! ctdb_nodes_start ; then + echo "Cluster start failed" + return 1 + fi - wait_until_ready 120 || ctdb_test_error "Cluster didn't become ready" + if ! wait_until_ready 120 ; then + echo "Cluster didn't become ready" + return 1 + fi echo "Setting RerecoveryTimeout to 1" onnode -pq all "$CTDB setvar RerecoveryTimeout 1" @@ -596,13 +602,16 @@ ctdb_init () if ! onnode -q all "$CTDB_TEST_WRAPPER _cluster_is_recovered" ; then echo "Cluster has gone into recovery again, waiting..." - wait_until 30/2 onnode -q all \ - "$CTDB_TEST_WRAPPER _cluster_is_recovered" || \ - ctdb_test_error "Cluster did not come out of recovery" + if ! wait_until 30/2 onnode -q all \ + "$CTDB_TEST_WRAPPER _cluster_is_recovered" ; then + echo "Cluster did not come out of recovery" + return 1 + fi fi if ! onnode 0 "$CTDB_TEST_WRAPPER _cluster_is_healthy" ; then - ctdb_test_error "Cluster became UNHEALTHY again [$(date)]" + echo "Cluster became UNHEALTHY again [$(date)]" + return 1 fi echo "Doing a sync..." |