ctdb-tests: Avoid bulk output in $out, prefer $outfile
[samba.git] / ctdb / tests / simple / 35_ctdb_getreclock.sh
1 #!/bin/bash
2
3 test_info()
4 {
5     cat <<EOF
6 Verify that "ctdb getreclock" gets the recovery lock correctly.
7
8 Make sure the recovery lock is consistent across all nodes.
9 EOF
10 }
11
12 . "${TEST_SCRIPTS_DIR}/integration.bash"
13
14 ctdb_test_init
15
16 set -e
17
18 cluster_is_healthy
19
20 echo "Check that recovery lock is set the same on all nodes..."
21 try_command_on_node -v -q all $CTDB getreclock
22
23 if [ -z "$out" ] ; then
24     echo "GOOD: Recovery lock is unset on all nodes"
25     exit 0
26 fi
27
28 n=$(sort -u "$outfile" | wc -l)
29 if [ "$n" = 1 ] ; then
30         echo "GOOD: All nodes have the same recovery lock setting"
31 else
32         echo "BAD: Recovery lock setting differs across nodes"
33         exit 1
34 fi