6 Run the ctdb_fetch 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_fetch 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_fetch 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_fetch on all $num_nodes nodes."
41 try_command_on_node -v -p all $CTDB_TEST_WRAPPER $VALGRIND ctdb_fetch -n $num_nodes
43 pat='^(Fetch: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec[[:space:]]?|msg_count=[[:digit:]]+ on node [[:digit:]]|Fetching final record|DATA:|Test data|Waiting for cluster[[:space:]]?|.*: Reqid wrap!|Sleeping for [[:digit:]]+ seconds|)+$'
44 sanity_check_output 1 "$pat" "$out"
46 # Filter out the performance figures:
47 out_fetch=$(echo "$out" | egrep '^(Fetch: .*)+$')
49 # Get the last line of output.
54 # $prev should look like this:
55 # Fetch: 10670.93 msgs/sec
56 stuff="${prev##*Fetch: }"
57 mps="${stuff% msgs/sec*}"
59 if [ ${mps%.*} -ge 10 ] ; then
60 echo "OK: $mps msgs/sec >= 10 msgs/sec"
62 echo "BAD: $mps msgs/sec < 10 msgs/sec"