6 Verify the operation of 'ctdb isnotrecmaster'.
10 * An active CTDB cluster with at least 2 active nodes.
14 1. Verify that the status on all of the ctdb nodes is 'OK'.
15 2. Run 'ctdb isnotrecmaster' on each node.
17 3. Verify that only 1 node shows the output 'This node is the
18 recmaster' and all the other nodes show the output 'This node is
23 * 'ctdb isnotrecmaster' shows the correct output.
27 . "${TEST_SCRIPTS_DIR}/integration.bash"
35 cmd="$CTDB isnotrecmaster || true"
36 try_command_on_node -v all "$cmd"
38 num_all_lines=$(wc -l <"$outfile")
39 num_rm_lines=$(grep -Fc 'this node is the recmaster' "$outfile") || true
40 num_not_rm_lines=$(grep -Fc 'this node is not the recmaster' "$outfile") || true
42 if [ $num_rm_lines -eq 1 ] ; then
43 echo "OK, there is only 1 recmaster"
45 die "BAD, there are ${num_rm_lines} nodes claiming to be the recmaster"
48 if [ $(($num_all_lines - $num_not_rm_lines)) -eq 1 ] ; then
49 echo "OK, all the other nodes claim not to be the recmaster"
51 die "BAD, there are only ${num_not_rm_lines} notrecmaster nodes"