summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-10-29 15:22:38 +1100
committerAmitay Isaacs <amitay@samba.org>2019-11-06 01:22:30 +0000
commitdd9d5ec5c8de82f343369ec4b26c0f24d465ce24 (patch)
treeb86d366faa04dc51392386c9861ade1909b2790b /ctdb
parent3b5ed00054e7d1e34cf33706c670e17a188c67d1 (diff)
downloadsamba-dd9d5ec5c8de82f343369ec4b26c0f24d465ce24.tar.gz
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 <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tests/scripts/integration.bash16
1 files changed, 9 insertions, 7 deletions
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