diff options
Diffstat (limited to 'ctdb/tests/INTEGRATION/simple/cluster.010.getrelock.sh')
-rwxr-xr-x | ctdb/tests/INTEGRATION/simple/cluster.010.getrelock.sh | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/ctdb/tests/INTEGRATION/simple/cluster.010.getrelock.sh b/ctdb/tests/INTEGRATION/simple/cluster.010.getrelock.sh index 03cf4317a39..3a766540db8 100755 --- a/ctdb/tests/INTEGRATION/simple/cluster.010.getrelock.sh +++ b/ctdb/tests/INTEGRATION/simple/cluster.010.getrelock.sh @@ -11,17 +11,14 @@ set -e ctdb_test_init echo "Check that recovery lock is set the same on all nodes..." -try_command_on_node -v -q all $CTDB getreclock - -if [ -z "$out" ] ; then - echo "GOOD: Recovery lock is unset on all nodes" - exit 0 -fi +ctdb_onnode all getreclock +# outfile is set above by ctdb_onnode +# shellcheck disable=SC2154 n=$(sort -u "$outfile" | wc -l | tr -d '[:space:]') -if [ "$n" = 1 ] ; then - echo "GOOD: All nodes have the same recovery lock setting" -else - echo "BAD: Recovery lock setting differs across nodes" - exit 1 -fi + +case "$n" in +0) echo "GOOD: Recovery lock is unset on all nodes" ;; +1) echo "GOOD: All nodes have the same recovery lock setting" ;; +*) ctdb_test_fail "BAD: Recovery lock setting differs across nodes" ;; +esac |