mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
b8b28cb567
Many tests currently do this sort of thing: onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 1 disconnected In fact, they all use exactly the same "onnode 0 $CTDB_TEST_WRAPPER" idiom. This is both repetitious and dangerous, since node 0 might be shutdown during a test. Instead, we push "onnode any $CTDB_TEST_WRAPPER" (which selects a connected node) into wait_until_node_has_status() and just call that function directly in tests, like this: wait_until_node_has_status 1 disconnected Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a2aaef03d4d6bbd4b42f50f732254935d4d3469c)
49 lines
962 B
Bash
Executable File
49 lines
962 B
Bash
Executable File
#!/bin/bash
|
|
|
|
test_info()
|
|
{
|
|
cat <<EOF
|
|
Verify 'ctdb freeze' works correctly.
|
|
|
|
This is a superficial test that simply checks that 'ctdb statistics'
|
|
reports the node becomes frozen. No checks are done to ensure that
|
|
client access to databases is blocked.
|
|
|
|
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. Use 'ctdb freeze -n <node>' to freeze the databases on one of the
|
|
nodes.
|
|
3. Run 'ctdb statistics' to verify that 'frozen' has the value '1' on
|
|
the node.
|
|
|
|
Expected results:
|
|
|
|
* When the database is frozen, the 'frozen' variable in the
|
|
'ctdb statistics' output is set to 1 on the node.
|
|
EOF
|
|
}
|
|
|
|
. ctdb_test_functions.bash
|
|
|
|
ctdb_test_init "$@"
|
|
|
|
set -e
|
|
|
|
cluster_is_healthy
|
|
|
|
# Reset configuration
|
|
ctdb_restart_when_done
|
|
|
|
test_node=1
|
|
|
|
echo "Freezing node $test_node"
|
|
|
|
try_command_on_node 0 $CTDB freeze -n $test_node
|
|
|
|
wait_until_node_has_status $test_node frozen
|