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 | 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.
29 last
=$
(tail -n 1 "$outfile")
31 pat
='^(Waiting for cluster|Ring\[[[:digit:]]+\]: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec \(\+ve=[[:digit:]]+ -ve=[[:digit:]]+\))$'
32 sanity_check_output
1 "$pat"
34 # $last should look like this:
35 # Ring[1]: 10670.93 msgs/sec (+ve=53391 -ve=53373)
36 stuff
="${last##Ring\[*\]: }"
37 mps
="${stuff% msgs/sec*}"
39 if [ ${mps%.*} -ge 10 ] ; then
40 echo "OK: $mps msgs/sec >= 10 msgs/sec"
42 echo "BAD: $mps msgs/sec < 10 msgs/sec"
46 stuff
="${stuff#*msgs/sec (+ve=}"
47 positive
="${stuff%% *}"
49 if [ $positive -ge 10 ] ; then
50 echo "OK: +ive ($positive) >= 10"
52 echo "BAD: +ive ($positive) < 10"
56 stuff
="${stuff#*-ve=}"
59 if [ $negative -ge 10 ] ; then
60 echo "OK: -ive ($negative) >= 10"
62 echo "BAD: -ive ($negative) < 10"