6 Verify that a node's public IP address can be deleted using 'ctdb deleteip'.
8 This test does not do any network level checks that the IP address is
9 no longer reachable but simply trusts 'ctdb ip' that the address has
14 * An active CTDB cluster with at least 2 active nodes.
18 1. Verify that the status on all of the ctdb nodes is 'OK'.
19 2. Use 'ctdb ip' on one of the nodes to list the IP addresses being
21 3. Delete one public IP address being be served by the node, using
23 4. Verify that the delete IP address is no longer listed using the
24 all_ips_on_node helper function.
28 * 'ctdb delip' removes an IP address from the list of public IP
29 addresses being served by a node.
33 . ctdb_test_functions.bash
42 ctdb_restart_when_done
44 echo "Getting list of public IPs..."
47 # Select an IP/node to remove.
48 num_ips=$(echo "$out" | wc -l)
49 num_to_remove=$(($RANDOM % $num_ips))
51 # Find the details in the list.
53 while [ $i -le $num_to_remove ] ; do
54 read ip_to_remove test_node
58 echo "Attempting to remove ${ip_to_remove} from node ${test_node}."
59 try_command_on_node $test_node $CTDB delip $ip_to_remove
65 while read ip pnn ; do
66 [ "$pnn" = "$test_node" ] && \
67 test_node_ips="${test_node_ips}${test_node_ips:+ }${ip}"
68 done <<<"$out" # bashism to avoid problem setting variable in pipeline.
70 if [ "${test_node_ips/${ip_to_remove}}" = "$test_node_ips" ] ; then
71 echo "GOOD: That worked!"
73 echo "BAD: The remove IP address is still there!"