3 # Verify that 'ctdb statisticsreset' works as expected
5 # This is pretty superficial. It just checks that a few particular
8 . "${TEST_SCRIPTS_DIR}/integration.bash"
14 try_command_on_node 0 "$CTDB listnodes | wc -l"
22 sed -rn -e "s@^[[:space:]]+${label}[[:space:]]+([[:digit:]])@\1@p" |
32 if [ $after -lt $before ] ; then
33 echo "GOOD: ${label} reduced from ${before} to ${after}"
35 die "BAD: ${label} did not reduce from ${before} to ${after}"
40 while [ $n -lt $num_nodes ] ; do
41 echo "Getting initial statistics for node ${n}..."
43 try_command_on_node -v $n $CTDB statistics
45 before_req_control=$(get_stat "req_control")
46 before_reply_control=$(get_stat "reply_control")
47 before_node_packets_recv=$(get_stat "node_packets_recv")
49 try_command_on_node $n $CTDB statisticsreset
51 try_command_on_node -v $n $CTDB statistics
53 after_req_control=$(get_stat "req_control")
54 after_reply_control=$(get_stat "reply_control")
55 after_node_packets_recv=$(get_stat "node_packets_recv")
57 check_reduced "req_control" "$before_req_control" "$after_req_control"
58 check_reduced "reply_control" "$before_reply_control" "$after_reply_control"
59 check_reduced "node_packets_recv" "$before_node_packets_recv" "$after_node_packets_recv"