replmd: Use replmd_set_la_val() when adding new links
[Samba.git] / ctdb / tests / complex / 61_rogueip_takeip.sh
blob1c087f6391d03fff0c8a9895895c35a65eb41648
1 #!/bin/bash
3 test_info()
5 cat <<EOF
6 Verify that TAKE_IP will work for an IP that is already on an interface
8 This is a variation of simple/60_recoverd_missing_ip.sh
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 "Running test against node $test_node and IP $test_ip"
27 get_test_ip_mask_and_iface
29 echo "Deleting IP $test_ip from all nodes"
30 delete_ip_from_all_nodes $test_ip
31 try_command_on_node -v $test_node $CTDB ipreallocate
32 wait_until_ips_are_on_node ! $test_node $test_ip
34 try_command_on_node -v all $CTDB ip
36 # The window here needs to small, to try to avoid the address being
37 # released. The test will still pass either way but if the first IP
38 # takeover run does a release then this doesn't test the code path we
39 # expect it to...
40 echo "Adding IP $test_ip to $iface and CTDB on node $test_node"
41 ip_cmd="ip addr add $test_ip/$mask dev $iface"
42 ctdb_cmd="$CTDB addip $test_ip/$mask $iface && $CTDB ipreallocate"
43 try_command_on_node $test_node "$ip_cmd && $ctdb_cmd"
45 wait_until_ips_are_on_node $test_node $test_ip