1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00
samba-mirror/ctdb/tests/simple/43_stop_recmaster_yield.sh
Martin Schwenke 9a2910c60b ctdb-tests: Drop passing of test arguments to ctdb_test_init()
Arguments are currently ignored anyway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-11-06 07:16:17 +01:00

52 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
test_info()
{
cat <<EOF
Verify that 'ctdb stop' causes a node to yield the recovery master role.
Prerequisites:
* An active CTDB cluster with at least 2 active nodes.
Steps:
1. Determine which node is the recmaster.
2. Stop this node using the 'ctdb stop' command.
3. Verify that the status of the node changes to 'stopped'.
4. Verify that this node no longer has the recovery master role.
Expected results:
* The 'ctdb stop' command causes a node to yield the recmaster role.
EOF
}
. "${TEST_SCRIPTS_DIR}/integration.bash"
ctdb_test_init
set -e
cluster_is_healthy
echo "Finding out which node is the recovery master..."
try_command_on_node -v 0 "$CTDB recmaster"
test_node=$out
echo "Stopping node ${test_node} - it is the current recmaster..."
try_command_on_node 1 $CTDB stop -n $test_node
wait_until_node_has_status $test_node stopped
echo "Checking which node is the recovery master now..."
try_command_on_node -v 0 "$CTDB recmaster"
recmaster=$out
if [ "$recmaster" != "$test_node" ] ; then
echo "OK: recmaster moved to node $recmaster"
else
echo "BAD: recmaster did not move"
exit 1
fi