6 Verify that a gratuitous ARP is sent when a node is failed out.
8 We ping a public IP and lookup the MAC address in the ARP table. We
9 then disable the node and check the ARP table again - the MAC address
10 should have changed. This test does NOT test connectivity after the
15 * An active CTDB cluster with at least 2 nodes with public addresses.
17 * Test must be run on a real or virtual cluster rather than against
20 * Test must not be run from a cluster node.
24 1. Verify that the cluster is healthy.
25 2. Select a public address and its corresponding node.
26 3. Remove any entries for the chosen address from the ARP table.
27 4. Send a single ping request packet to the selected public address.
28 5. Determine the MAC address corresponding to the public address by
29 checking the ARP table.
30 6. Disable the selected node.
31 7. Check the ARP table and check the MAC associated with the public
36 * When a node is disabled the MAC address associated with public
37 addresses on that node should change.
41 .
"${TEST_SCRIPTS_DIR}/integration.bash"
47 ctdb_test_check_real_cluster
52 ctdb_restart_when_done
54 select_test_node_and_ips
56 echo "Removing ${test_ip} from the local ARP table..."
57 ip neigh flush
"$test_prefix" >/dev
/null
2>&1 || true
59 echo "Pinging ${test_ip}..."
60 ping_wrapper
-q -n -c 1 $test_ip
62 echo "Getting MAC address associated with ${test_ip}..."
63 original_mac
=$
(ip neigh show
$test_prefix |
awk '$4 == "lladdr" {print $5}')
64 [ -n "$original_mac" ] || die
"Couldn't get MAC address for ${test_prefix}"
66 echo "MAC address is: ${original_mac}"
70 echo "Disabling node $test_node"
71 try_command_on_node
1 $CTDB disable
-n $test_node
72 wait_until_node_has_status
$test_node disabled
74 gratarp_sniff_wait_show
76 echo "Getting MAC address associated with ${test_ip} again..."
77 new_mac
=$
(ip neigh show
$test_prefix |
awk '$4 == "lladdr" {print $5}')
78 [ -n "$new_mac" ] || die
"Couldn't get MAC address for ${test_prefix}"
80 echo "MAC address is: ${new_mac}"
82 if [ "$original_mac" != "$new_mac" ] ; then
83 echo "GOOD: MAC address changed"
85 echo "BAD: MAC address did not change"