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 all
"$cmd"
37 echo "Output of \"$cmd\":"
40 num_all_lines
=$
(echo "$out" |
wc -l)
41 num_rm_lines
=$
(echo "$out" | fgrep
-c 'this node is the recmaster') || true
42 num_not_rm_lines
=$
(echo "$out" | fgrep
-c 'this node is not the recmaster') || true
44 if [ $num_rm_lines -eq 1 ] ; then
45 echo "OK, there is only 1 recmaster"
47 echo "BAD, there are ${num_rm_lines} nodes claiming to be the recmaster"
51 if [ $
(($num_all_lines - $num_not_rm_lines)) -eq 1 ] ; then
52 echo "OK, all the other nodes claim not to be the recmaster"
54 echo "BAD, there are only ${num_not_rm_lines} nodes claiming not to be the recmaster"