6 Run the ctdb_bench test and sanity check the output.
8 This doesn't test for performance regressions or similarly anything
9 useful. Only vague sanity checking of results is done.
13 * An active CTDB cluster with at least 2 active nodes.
17 1. Verify that the status on all of the ctdb nodes is 'OK'.
18 2. Run ctdb_bench on all nodes with default options.
19 3. Ensure that the number of +ve and -ive messages are within 1% of
21 4. Ensure that the number of messages per second is greater than 10.
25 * ctdb_bench runs without error and prints reasonable results.
29 .
"${TEST_SCRIPTS_DIR}/integration.bash"
37 try_command_on_node
0 "$CTDB listnodes"
38 num_nodes
=$
(echo "$out" |
wc -l)
40 echo "Running ctdb_bench on all $num_nodes nodes."
41 try_command_on_node
-v -p all
$CTDB_TEST_WRAPPER $VALGRIND ctdb_bench
-n $num_nodes
43 # Get the last line of output.
48 pat
='^(Ring: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec \(\+ve=[[:digit:]]+ -ve=[[:digit:]]+\)[[:space:]]?|Waiting for cluster[[:space:]]?)+$'
49 sanity_check_output
1 "$pat" "$out"
51 # $prev should look like this:
52 # Ring: 10670.93 msgs/sec (+ve=53391 -ve=53373)
53 stuff
="${prev##*Ring: }"
54 mps
="${stuff% msgs/sec*}"
56 if [ ${mps%.*} -ge 10 ] ; then
57 echo "OK: $mps msgs/sec >= 10 msgs/sec"
59 echo "BAD: $mps msgs/sec < 10 msgs/sec"
63 stuff
="${stuff#*msgs/sec (+ve=}"
64 positive
="${stuff%% *}"
66 if [ $positive -gt 0 ] ; then
67 echo "OK: +ive ($positive) > 0"
69 echo "BAD: +ive ($positive) = 0"
73 stuff
="${stuff#*-ve=}"
76 if [ $negative -gt 0 ] ; then
77 echo "OK: -ive ($negative) > 0"
79 echo "BAD: -ive ($negative) = 0"
83 perc_diff
=$
(( ($positive - $negative) * 100 / $positive ))
84 perc_diff
=${perc_diff#-}
87 if [ $perc_diff -le $check_percent ] ; then
88 echo "OK: percentage difference between +ive and -ive ($perc_diff%) <= $check_percent%"
90 echo "BAD: percentage difference between +ive and -ive ($perc_diff%) > $check_percent%"