replmd: Use replmd_set_la_val() when adding new links
[Samba.git] / ctdb / tests / complex / 60_rogueip_releaseip.sh
blob0daf289c83ab3569526f33c725a3a885d89d6cf0
1 #!/bin/bash
3 test_info()
5 cat <<EOF
6 Verify that the recovery daemon correctly handles a rogue IP
8 It should be released...
9 EOF
12 . "${TEST_SCRIPTS_DIR}/integration.bash"
14 ctdb_test_init "$@"
16 set -e
18 cluster_is_healthy
20 # Reset configuration
21 ctdb_restart_when_done
23 select_test_node_and_ips
25 echo "Using $test_ip, which is onnode $test_node"
27 get_test_ip_mask_and_iface
29 echo "Finding another node that knows about $test_ip"
30 ctdb_get_all_pnns
31 other_node=""
32 for i in $all_pnns ; do
33 if [ "$i" = "$test_node" ] ; then
34 continue
36 try_command_on_node $i "$CTDB ip"
37 n=$(awk -v ip="$test_ip" '$1 == ip { print }' <<<"$out")
38 if [ -n "$n" ] ; then
39 other_node="$i"
40 break
42 done
43 if [ -z "$other_node" ] ; then
44 die "Unable to find another node that knows about $test_ip"
47 echo "Adding $test_ip on node $other_node"
48 try_command_on_node $other_node "ip addr add ${test_ip}/${mask} dev ${iface}"
50 rogue_ip_is_gone ()
52 local pnn="$1"
53 local test_ip="$2"
54 try_command_on_node $pnn $CTDB_TEST_WRAPPER ip_maskbits_iface $test_ip
55 [ -z "$out" ]
58 echo "Waiting until rogue IP is no longer assigned..."
59 wait_until 30 rogue_ip_is_gone $other_node $test_ip