2009-07-03 14:55:02 +04:00
#!/bin/bash
2019-09-11 09:07:49 +03:00
# Verify that it is possible to ping a public address after disabling a node.
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# We ping a public IP, disable the node hosting it and then ping the
# public IP again.
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# Prerequisites:
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# * An active CTDB cluster with at least 2 nodes with public addresses.
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# * Test must be run on a real or virtual cluster rather than against
# local daemons.
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# * Test must not be run from a cluster node.
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# Steps:
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# 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.
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# Expected results:
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
# * When a node is disabled the public address fails over and the
# address is still pingable.
2009-07-03 14:55:02 +04:00
2019-09-11 09:07:49 +03:00
. " ${ TEST_SCRIPTS_DIR } /cluster.bash "
2009-07-03 14:55:02 +04:00
set -e
2018-10-08 07:04:24 +03:00
ctdb_test_init
2009-07-03 14:55:02 +04:00
2009-07-08 07:37:52 +04:00
select_test_node_and_ips
2009-07-03 14:55:02 +04:00
2014-11-29 12:01:20 +03:00
echo " Removing ${ test_ip } from the local neighbor table... "
ip neigh flush " $test_prefix " >/dev/null 2>& 1 || true
2009-07-03 14:55:02 +04:00
echo " Pinging ${ test_ip } ... "
2014-12-01 05:50:42 +03:00
ping_wrapper -q -n -c 1 $test_ip
2009-07-03 14:55:02 +04:00
2009-07-08 07:37:52 +04:00
gratarp_sniff_start
2009-07-03 14:55:02 +04:00
echo " Disabling node $test_node "
try_command_on_node 1 $CTDB disable -n $test_node
2009-09-11 10:15:31 +04:00
wait_until_node_has_status $test_node disabled
2009-07-03 14:55:02 +04:00
2009-07-08 07:37:52 +04:00
gratarp_sniff_wait_show
2009-07-03 14:55:02 +04:00
2014-11-29 12:01:20 +03:00
echo " Removing ${ test_ip } from the local neighbor table again... "
ip neigh flush " $test_prefix " >/dev/null 2>& 1 || true
2009-07-03 14:55:02 +04:00
echo " Pinging ${ test_ip } again... "
2014-12-01 05:50:42 +03:00
ping_wrapper -q -n -c 1 $test_ip