6 Verify that 'ctdb statisticsreset' works as expected.
8 This is pretty superficial. It just checks that a few particular
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 statisticsreset' on all nodes and verify that it executes
23 * 'ctdb statisticsreset' executes successfully.
27 .
"${TEST_SCRIPTS_DIR}/integration.bash"
35 try_command_on_node
0 "$CTDB listnodes | wc -l"
43 echo "$out" |
sed -rn -e "s@^[[:space:]]+${label}[[:space:]]+([[:digit:]])@\1@p" |
head -1
52 if [ $after -lt $before ] ; then
53 echo "GOOD: ${label} reduced from ${before} to ${after}"
55 echo "BAD: ${label} did not reduce from ${before} to ${after}"
61 while [ $n -lt $num_nodes ] ; do
62 echo "Getting initial statistics for node ${n}..."
64 try_command_on_node
-v $n $CTDB statistics
66 before_req_control
=$
(get_stat
"req_control" "$out")
67 before_reply_control
=$
(get_stat
"reply_control" "$out")
68 before_node_packets_recv
=$
(get_stat
"node_packets_recv" "$out")
70 try_command_on_node
$n $CTDB statisticsreset
72 try_command_on_node
-v $n $CTDB statistics
74 after_req_control
=$
(get_stat
"req_control" "$out")
75 after_reply_control
=$
(get_stat
"reply_control" "$out")
76 after_node_packets_recv
=$
(get_stat
"node_packets_recv" "$out")
78 check_reduced
"req_control" "$before_req_control" "$after_req_control"
79 check_reduced
"reply_control" "$before_reply_control" "$after_reply_control"
80 check_reduced
"node_packets_recv" "$before_node_packets_recv" "$after_node_packets_recv"