6 Run the message_ring test and sanity check the output.
10 * An active CTDB cluster with at least 2 active nodes.
14 . "${TEST_SCRIPTS_DIR}/integration.bash"
22 try_command_on_node 0 "$CTDB listnodes"
23 num_nodes=$(echo "$out" | wc -l)
25 echo "Running message_ring on all $num_nodes nodes."
26 try_command_on_node -v -p all $CTDB_TEST_WRAPPER $VALGRIND message_ring -n $num_nodes
28 # Get the last line of output.
33 pat='^(Waiting for cluster|Ring\[[[:digit:]]+\]: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec \(\+ve=[[:digit:]]+ -ve=[[:digit:]]+\))$'
34 sanity_check_output 1 "$pat" "$out"
36 # $prev should look like this:
37 # Ring[1]: 10670.93 msgs/sec (+ve=53391 -ve=53373)
38 stuff="${prev##Ring\[*\]: }"
39 mps="${stuff% msgs/sec*}"
41 if [ ${mps%.*} -ge 10 ] ; then
42 echo "OK: $mps msgs/sec >= 10 msgs/sec"
44 echo "BAD: $mps msgs/sec < 10 msgs/sec"
48 stuff="${stuff#*msgs/sec (+ve=}"
49 positive="${stuff%% *}"
51 if [ $positive -ge 10 ] ; then
52 echo "OK: +ive ($positive) >= 10"
54 echo "BAD: +ive ($positive) < 10"
58 stuff="${stuff#*-ve=}"
61 if [ $negative -ge 10 ] ; then
62 echo "OK: -ive ($negative) >= 10"
64 echo "BAD: -ive ($negative) < 10"