From: Martin Schwenke Date: Tue, 29 Oct 2019 04:22:38 +0000 (+1100) Subject: ctdb-tests: Improve code quality in ctdb_init() X-Git-Tag: talloc-2.3.1~138 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dd9d5ec5c8de82f343369ec4b26c0f24d465ce24;p=thirdparty%2Fsamba.git ctdb-tests: Improve code quality in ctdb_init() Improve quoting and indentation. Print a clear error if the cluster goes back into recovery and doesn't come back out. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index e36af5f9d51..51e9c7cb822 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -578,20 +578,22 @@ ctdb_init () onnode -pq all "$CTDB setvar RerecoveryTimeout 1" echo "Forcing a recovery..." - onnode -q 0 $CTDB recover + onnode -q 0 "$CTDB recover" sleep_for 2 - if ! onnode -q any $CTDB_TEST_WRAPPER _cluster_is_recovered ; then - echo "Cluster has gone into recovery again, waiting..." - wait_until 30/2 onnode -q any $CTDB_TEST_WRAPPER _cluster_is_recovered + 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" fi - if ! onnode 0 $CTDB_TEST_WRAPPER _cluster_is_healthy ; then - ctdb_test_error "Cluster became UNHEALTHY again [$(date)]" + if ! onnode 0 "$CTDB_TEST_WRAPPER _cluster_is_healthy" ; then + ctdb_test_error "Cluster became UNHEALTHY again [$(date)]" fi echo "Doing a sync..." - onnode -q 0 $CTDB sync + onnode -q 0 "$CTDB sync" echo "ctdb is ready" return 0