6 Verify the operation of 'ctdb disable'.
8 This is a superficial test of the 'ctdb disable' command. It trusts
9 information from CTDB that indicates that the IP failover has happened
10 correctly. Another test should check that the failover has actually
11 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. Disable one of the nodes using 'ctdb disable -n <node>'.
21 3. Verify that the status of the node changes to 'disabled'.
22 4. Verify that the IP addreses served by the disabled node are failed
27 * The status of the disabled node changes as expected and IP addresses
32 . ctdb_test_functions.bash
41 ctdb_restart_when_done
43 echo "Getting list of public IPs..."
44 try_command_on_node 0 "$CTDB ip -n all | sed -e '1d'"
46 # When selecting test_node we just want a node that has public IPs.
47 # This will work and is economically semi-randomly. :-)
48 read x test_node <<<"$out"
51 while read ip pnn ; do
52 if [ "$pnn" = "$test_node" ] ; then
53 ips="${ips}${ips:+ }${ip}"
55 done <<<"$out" # bashism to avoid problem setting variable in pipeline.
57 echo "Selected node ${test_node} with IPs: $ips"
59 echo "Disabling node $test_node"
61 try_command_on_node 1 $CTDB disable -n $test_node
63 # Avoid a potential race condition...
64 onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node disabled
66 if wait_until_ips_are_on_nodeglob "[!${test_node}]" $ips ; then
69 echo "Some IPs didn't move."