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"
26 try_command_on_node
$test_node "$CTDB ip -v -Y | awk -F: -v ip=$test_ip '\$2 == ip { print \$4 }'"
29 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
31 try_command_on_node
$test_node ip addr show to
$test_ip
38 echo "$test_ip/$mask is on $iface"
40 echo "Deleting IP $test_ip from all nodes"
41 try_command_on_node
-v $test_node $CTDB delip
-n all
$test_ip
43 wait_until_ips_are_on_nodeglob
'!' $test_node $test_ip
45 try_command_on_node
-v all
$CTDB ip
49 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
50 onnode
-q all
$CTDB enablescript
"10.interface"
54 ctdb_test_exit_hook_add my_exit_hook
56 # This forces us to wait until the ipreallocated associated with the
58 try_command_on_node
$test_node $CTDB sync
60 # Wait for a monitor event. Then the next steps are unlikely to occur
61 # in the middle of a monitor event and will have the expected effect.
62 wait_for_monitor_event
$test_node
64 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
65 # Stop monitor events from bringing up the link status of an interface
66 try_command_on_node
$test_node $CTDB disablescript
10.interface
69 echo "Marking interface $iface down on node $test_node"
70 try_command_on_node
$test_node $CTDB setifacelink
$iface down
72 try_command_on_node
$test_node $CTDB clearlog recoverd
74 echo "Adding IP $test_ip to node $test_node"
75 try_command_on_node
$test_node $CTDB addip
$test_ip/$mask $iface
77 # Give the recovery daemon enough time to start doing IP verification
80 try_command_on_node
$test_node $CTDB getlog recoverd
82 msg
="Public IP '$test_ip' is not assigned and we could serve it"
84 if grep "$msg" <<<"$out" ; then
85 echo "BAD: the recovery daemon noticed that the IP was unhosted"
88 echo "GOOD: the recovery daemon did not notice that the IP was unhosted"
91 try_command_on_node
$test_node $CTDB clearlog recoverd
93 echo "Marking interface $iface up on node $test_node"
94 try_command_on_node
$test_node $CTDB setifacelink
$iface up
96 wait_until_ips_are_on_nodeglob
$test_node $test_ip
98 try_command_on_node
-v $test_node $CTDB getlog recoverd
100 if grep "$msg" <<<"$out" ; then
101 echo "GOOD: the recovery daemon noticed that the IP was unhosted"
103 echo "BAD: the recovery daemon did not notice that the IP was unhosted"