6 Verify that 'ctdb moveip' allows movement of public IPs between cluster nodes.
8 This test does not do any network level checks to make sure IP
9 addresses are actually on interfaces. It just consults "ctdb ip".
11 To work, this test ensures that IPAllocAlgorithm is not set to 0
12 (Deterministic IPs) and sets NoIPFailback.
16 . "${TEST_SCRIPTS_DIR}/integration.bash"
24 select_test_node_and_ips
28 echo "Sanity checking IPs..."
33 [ "$ipp" = "-1" ] && break
34 if [ -n "$prev" -a "$ipp" != "$prev" ] ; then
41 echo "BAD: a node was -1 or IPs are only assigned to one node:"
43 echo "Are you running an old version of CTDB?"
49 # Find a target node - it must be willing to host $test_ip
50 try_command_on_node any "$CTDB listnodes | wc -l"
53 for i in $(seq 0 $(($num_nodes - 1)) ) ; do
54 [ $i -ne $test_node ] || continue
57 if [ "$ip" = "$test_ip" ] ; then
64 if [ -z "$to_node" ] ; then
65 echo "Unable to find target node"
69 echo "Target node is ${to_node}"
71 echo "Setting IPAllocAlgorithm=2 to avoid Deterministic IPs..."
72 try_command_on_node -q all $CTDB setvar IPAllocAlgorithm 2
74 echo "Turning on NoIPFailback..."
75 try_command_on_node -q all $CTDB setvar NoIPFailback 1
77 echo "Attempting to move ${test_ip} from node ${test_node} to node ${to_node}"
78 try_command_on_node $test_node $CTDB moveip $test_ip $to_node
79 wait_until_ips_are_on_node '!' $test_node $test_ip
80 wait_until_ips_are_on_node $to_node $test_ip