]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Improve code quality in ctdb_init()
authorMartin Schwenke <martin@meltin.net>
Tue, 29 Oct 2019 04:22:38 +0000 (15:22 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 6 Nov 2019 01:22:30 +0000 (01:22 +0000)
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/scripts/integration.bash

index e36af5f9d51cadda39afb122634a1c13fcad7f70..51e9c7cb82216775c801e36aa4a7ca1c82c9deaa 100644 (file)
@@ -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