6 Verify the operation of the 'ctdb unban' command.
8 This is a superficial test of the 'ctdb uban' command. It trusts
9 information from CTDB that indicates that the IP failover and failback
10 has happened correctly. Another test should check that the failover
11 and failback has actually happened at the networking level.
15 * An active CTDB cluster with at least 2 active nodes.
19 1. Verify that the status on all of the ctdb nodes is 'OK'.
20 2. Ban one of the nodes using the 'ctdb ban <timeout>' command.
21 3. Before the ban timeout expires, verify that the status of the
22 node changes to 'banned'.
23 4. Verify that the public IP addresses that were being served by
24 the node are failed over to one of the other nodes.
25 5. Before the ban timeout expires, use 'ctdb unban' to unban the
27 6. Verify that the status of the node changes back to 'OK' and that
28 the public IP addresses move back to the node.
32 * The 'ctdb unban' command successfully unbans a banned node.
36 . ctdb_test_functions.bash
42 onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
44 echo "Finding out which node is the recovery master..."
45 try_command_on_node -v 0 "$CTDB recmaster"
48 echo "Getting list of public IPs..."
49 try_command_on_node 0 "$CTDB ip -n all | sed -e '1d'"
51 # See 41_ctdb_ban.sh for an explanation of why test_node is chosen
56 while read ip pnn ; do
57 [ -z "$test_node" -a $recmaster -ne $pnn ] && test_node=$pnn
58 [ "$pnn" = "$test_node" ] && ips="${ips}${ips:+ }${ip}"
59 done <<<"$out" # bashism to avoid problem setting variable in pipeline.
61 if [ -z "$test_node" ] ; then
62 echo "BAD: unable to select a suitable node for banning."
66 echo "Selected node ${test_node} with IPs: $ips"
70 echo "Banning node $test_node for $ban_time seconds"
71 try_command_on_node 1 $CTDB ban $ban_time -n $test_node
73 # Avoid a potential race condition...
74 onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node banned
76 if wait_until_ips_are_on_nodeglob "[!${test_node}]" $ips ; then
79 echo "Some IPs didn't move."
83 echo "Unbanning node $test_node"
84 try_command_on_node 1 $CTDB unban -n $test_node
86 onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node unbanned
88 # BUG: this is only guaranteed if DeterministicIPs is 1 and
90 if wait_until_ips_are_on_nodeglob "$test_node" $ips ; then
93 echo "Some IPs didn't move."