6 Verify that it is possible to ping a public address after disabling a node.
8 We ping a public IP, disable the node hosting it and then ping the
13 * An active CTDB cluster with at least 2 nodes with public addresses.
15 * Test must be run on a real or virtual cluster rather than against
18 * Test must not be run from a cluster node.
22 1. Verify that the cluster is healthy.
23 2. Select a public address and its corresponding node.
24 3. Send a single ping request packet to the selected public address.
25 4. Disable the selected node.
26 5. Send another single ping request packet to the selected public address.
30 * When a node is disabled the public address fails over and the
31 address is still pingable.
35 . ctdb_test_functions.bash
41 ctdb_test_check_real_cluster
46 ctdb_restart_when_done
48 echo "Getting list of public IPs..."
49 try_command_on_node 0 "$CTDB ip -n all | sed -e '1d'"
51 # When selecting test_node we just want a node that has public IPs.
52 # This will work and is economically semi-randomly. :-)
53 read x test_node <<<"$out"
56 while read ip pnn ; do
57 if [ "$pnn" = "$test_node" ] ; then
58 ips="${ips}${ips:+ }${ip}"
60 done <<<"$out" # bashism to avoid problem setting variable in pipeline.
62 echo "Selected node ${test_node} with IPs: $ips"
66 echo "Removing ${test_ip} from the local ARP table..."
67 arp -d $test_ip >/dev/null 2>&1 || true
69 echo "Pinging ${test_ip}..."
70 ping -q -n -c 1 $test_ip
72 filter="arp net ${test_ip}"
73 tcpdump_start "$filter"
75 echo "Disabling node $test_node"
76 try_command_on_node 1 $CTDB disable -n $test_node
77 onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node disabled
81 echo "GOOD: this should be the gratuitous ARP and the reply:"
84 echo "Removing ${test_ip} from the local ARP table again..."
85 arp -d $test_ip >/dev/null 2>&1 || true
87 echo "Pinging ${test_ip} again..."
88 ping -q -n -c 1 $test_ip