1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00
samba-mirror/ctdb/tests/complex/41_failover_ping_discrete.sh
Martin Schwenke bf197d097f tests: Rename ctdb_test_functions.bash to integration.bash
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 79adb50b3ce3873c3baf9e6715c1d1c3f181ce43)
2012-04-27 15:40:43 +10:00

69 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
test_info()
{
cat <<EOF
Verify that it is possible to ping a public address after disabling a node.
We ping a public IP, disable the node hosting it and then ping the
public IP again.
Prerequisites:
* An active CTDB cluster with at least 2 nodes with public addresses.
* Test must be run on a real or virtual cluster rather than against
local daemons.
* Test must not be run from a cluster node.
Steps:
1. Verify that the cluster is healthy.
2. Select a public address and its corresponding node.
3. Send a single ping request packet to the selected public address.
4. Disable the selected node.
5. Send another single ping request packet to the selected public address.
Expected results:
* When a node is disabled the public address fails over and the
address is still pingable.
EOF
}
. "${TEST_SCRIPTS_DIR}/integration.bash"
set -e
ctdb_test_init "$@"
ctdb_test_check_real_cluster
cluster_is_healthy
# Reset configuration
ctdb_restart_when_done
select_test_node_and_ips
echo "Removing ${test_ip} from the local ARP table..."
arp -d $test_ip >/dev/null 2>&1 || true
echo "Pinging ${test_ip}..."
ping -q -n -c 1 $test_ip
gratarp_sniff_start
echo "Disabling node $test_node"
try_command_on_node 1 $CTDB disable -n $test_node
wait_until_node_has_status $test_node disabled
gratarp_sniff_wait_show
echo "Removing ${test_ip} from the local ARP table again..."
arp -d $test_ip >/dev/null 2>&1 || true
echo "Pinging ${test_ip} again..."
ping -q -n -c 1 $test_ip