1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00
samba-mirror/ctdb/tests/simple/09_ctdb_ping.sh
Martin Schwenke 3cdc0cb708 $PATH only inludes $CTDB_DIR/bin if we're using local sockets. Rename
$TEST_WRAP to $CTDB_TEST_WRAPPER - value now set using
$CTDB_TEST_REMOTE_SCRIPTS_DIR if that is set.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a69545d7dec78eefb85a1598e5db4667cc210bf9)
2008-12-03 15:48:24 +11:00

59 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
test_info()
{
cat <<EOF
Verify the operation of the 'ctdb ping' command.
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 the 'ctdb ping' command on one of the nodes and verify that it
shows valid and expected output.
3. Shutdown one of the cluster nodes, using the 'ctdb shutdown'
command.
4. Run the 'ctdb ping -n <node>' command from another node to this
node.
5. Verify that the command is not successful since th ctdb daemon is
not running on the node.
Expected results:
* The 'ctdb ping' command shows valid and expected output.
EOF
}
. ctdb_test_functions.bash
ctdb_test_init "$@"
set -e
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node -v 1 'ctdb ping -n 2'
sanity_check_output \
1 \
'^response from 2 time=[.0-9]+ sec[[:space:]]+\([[:digit:]]+ clients\)$' \
"$out"
try_command_on_node -v 0 'ctdb shutdown -n 2'
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 disconnected
try_command_on_node 1 'ctdb ping -n 2'
sanity_check_output \
2 \
"(: ctdb_control error: 'ctdb_control to disconnected node'|Unable to get ping response from node 2)" \
"$out"
echo "Expect a restart..."
ctdb_test_exit