summaryrefslogtreecommitdiff
path: root/ctdb/tests/INTEGRATION/simple/cluster.010.getrelock.sh
blob: 03cf4317a39839d81d4fb910aab0f74bdb363253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash

# Verify that "ctdb getreclock" gets the recovery lock correctly

# Make sure the recovery lock is consistent across all nodes.

. "${TEST_SCRIPTS_DIR}/integration.bash"

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

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