6 Verify that the reconvery daemon handles unhosted IPs properly.
10 .
"${TEST_SCRIPTS_DIR}/integration.bash"
19 ctdb_restart_when_done
21 select_test_node_and_ips
23 echo "Running test against node $test_node and IP $test_ip"
25 get_test_ip_mask_and_iface
26 echo "$test_ip/$mask is on $iface"
28 echo "Deleting IP $test_ip from all nodes"
29 try_command_on_node
-v $test_node $CTDB delip
-n all
$test_ip
31 wait_until_ips_are_on_node
'!' $test_node $test_ip
33 try_command_on_node
-v all
$CTDB ip
37 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
38 onnode
-q all
$CTDB enablescript
"10.interface"
42 ctdb_test_exit_hook_add my_exit_hook
44 # This forces us to wait until the ipreallocated associated with the
46 try_command_on_node
$test_node $CTDB sync
48 # Wait for a monitor event. Then the next steps are unlikely to occur
49 # in the middle of a monitor event and will have the expected effect.
50 wait_for_monitor_event
$test_node
52 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
53 # Stop monitor events from bringing up the link status of an interface
54 try_command_on_node
$test_node $CTDB disablescript
10.interface
57 echo "Marking interface $iface down on node $test_node"
58 try_command_on_node
$test_node $CTDB setifacelink
$iface down
60 try_command_on_node
$test_node $CTDB clearlog recoverd
62 echo "Adding IP $test_ip to node $test_node"
63 try_command_on_node
$test_node $CTDB addip
$test_ip/$mask $iface
65 # Give the recovery daemon enough time to start doing IP verification
68 try_command_on_node
$test_node $CTDB getlog recoverd
70 msg
="Public IP '$test_ip' is not assigned and we could serve it"
72 if grep "$msg" <<<"$out" ; then
73 echo "BAD: the recovery daemon noticed that the IP was unhosted"
76 echo "GOOD: the recovery daemon did not notice that the IP was unhosted"
79 try_command_on_node
$test_node $CTDB clearlog recoverd
81 echo "Marking interface $iface up on node $test_node"
82 try_command_on_node
$test_node $CTDB setifacelink
$iface up
84 wait_until_ips_are_on_node
$test_node $test_ip
86 try_command_on_node
-v $test_node $CTDB getlog recoverd
88 if grep "$msg" <<<"$out" ; then
89 echo "GOOD: the recovery daemon noticed that the IP was unhosted"
91 echo "BAD: the recovery daemon did not notice that the IP was unhosted"