mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
96b3517356
cluster_is_healthy() is now run locally in tests and internally causes _cluster_is_healthy() to be run on node 0. When it detects that the cluster is unhealthy and $ctdb_test_restart_scheduled is not true, debug information is printed. This replaces the previous use of $CTDB_TEST_CLEANING_UP. To avoid spurious debug on expected restarts, added scheduled restarts to several tests. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ee7caae3a55a64fb50cd28fa2fd4663c5dd83b4f)
45 lines
1.0 KiB
Bash
Executable File
45 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
test_info()
|
|
{
|
|
cat <<EOF
|
|
Verify that 'ctdb statistics' works as expected.
|
|
|
|
This is pretty superficial and could do more validation.
|
|
|
|
Prerequisites:
|
|
|
|
* An active CTDB cluster with at least 2 active nodes.
|
|
|
|
Steps:
|
|
|
|
1. Verify that the status on all of the ctdb nodes is 'OK'.
|
|
2. Run 'ctdb statistics' on a node, and verify that the output is
|
|
valid.
|
|
3. Repeat the command with the '-n all' option and verify that the
|
|
output is valid.
|
|
|
|
Expected results:
|
|
|
|
* 'ctdb statistics' shows valid output on all the nodes.
|
|
EOF
|
|
}
|
|
|
|
. ctdb_test_functions.bash
|
|
|
|
ctdb_test_init "$@"
|
|
|
|
set -e
|
|
|
|
cluster_is_healthy
|
|
|
|
pattern='^(CTDB version 1|Gathered statistics for [[:digit:]]+ nodes|[[:space:]]+[[:alpha:]_]+[[:space:]]+[[:digit:]]+|[[:space:]]+(node|client|timeouts)|[[:space:]]+([[:alpha:]_]+_latency|max_reclock_[[:alpha:]]+)[[:space:]]+[[:digit:]-]+\.[[:digit:]]+[[:space:]]sec)$'
|
|
|
|
try_command_on_node -v 1 "$CTDB statistics"
|
|
|
|
sanity_check_output 40 "$pattern" "$out"
|
|
|
|
try_command_on_node -v 1 "$CTDB statistics -n all"
|
|
|
|
sanity_check_output 40 "$pattern" "$out"
|