6 Verify that the recovery daemon handles unhosted IPs properly.
8 This test does not do any network level checks to make sure the IP
9 address is actually on an interface. It just consults "ctdb ip".
11 This is a variation of the "addip" test.
15 . "${TEST_SCRIPTS_DIR}/integration.bash"
24 ctdb_restart_when_done
26 select_test_node_and_ips
28 echo "Running test against node $test_node and IP $test_ip"
30 get_test_ip_mask_and_iface
32 echo "Deleting IP $test_ip from all nodes"
33 delete_ip_from_all_nodes $test_ip
34 try_command_on_node -v $test_node $CTDB ipreallocate
35 wait_until_ips_are_on_node ! $test_node $test_ip
37 try_command_on_node -v all $CTDB ip
41 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
42 onnode -q all $CTDB event script enable "10.interface"
46 ctdb_test_exit_hook_add my_exit_hook
48 # This forces us to wait until the ipreallocated associated with the
50 try_command_on_node $test_node $CTDB sync
52 # Wait for a monitor event. Then the next steps are unlikely to occur
53 # in the middle of a monitor event and will have the expected effect.
54 wait_for_monitor_event $test_node
56 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
57 # Stop monitor events from bringing up the link status of an interface
58 try_command_on_node $test_node $CTDB event script disable 10.interface
61 echo "Marking interface $iface down on node $test_node"
62 try_command_on_node $test_node $CTDB setifacelink $iface down
64 echo "Adding IP $test_ip to node $test_node"
65 try_command_on_node $test_node $CTDB addip $test_ip/$mask $iface
66 try_command_on_node $test_node $CTDB ipreallocate
68 echo "Wait long enough for IP verification to have taken place"
71 echo "Ensuring that IP ${test_ip} is not hosted on node ${test_node} when interface is down"
72 if ips_are_on_node '!' $test_node $test_ip; then
73 echo "GOOD: the IP has not been hosted while the interface is down"
75 echo "BAD: the IP is hosted but the interface is down"
79 echo "Marking interface $iface up on node $test_node"
80 try_command_on_node $test_node $CTDB setifacelink $iface up
81 wait_until_ips_are_on_node $test_node $test_ip