0bc668a906e328395aa81968976e1fda5c47c0ba
[amitay/samba.git] / ctdb / tests / simple / 16_ctdb_config_add_ip.sh
1 #!/bin/bash
2
3 test_info()
4 {
5     cat <<EOF
6 Verify that an IP address can be added to a node using 'ctdb addip'.
7
8 This test does not do any network level checks to make sure IP
9 addresses are actually on interfaces.  It just consults "ctdb ip".
10 EOF
11 }
12
13 . "${TEST_SCRIPTS_DIR}/integration.bash"
14
15 ctdb_test_init "$@"
16
17 set -e
18
19 cluster_is_healthy
20
21 # Reset configuration
22 ctdb_restart_when_done
23
24 select_test_node_and_ips
25 get_test_ip_mask_and_iface
26
27 echo "Deleting IP $test_ip from all nodes"
28 delete_ip_from_all_nodes $test_ip
29 try_command_on_node -v $test_node $CTDB ipreallocate
30 wait_until_ips_are_on_node '!' $test_node $test_ip
31
32 # Debugging...
33 try_command_on_node -v all $CTDB ip
34
35 echo "Adding IP ${test_ip}/${mask} on ${iface}, node ${test_node}"
36 try_command_on_node $test_node $CTDB addip ${test_ip}/${mask} $iface
37 try_command_on_node $test_node $CTDB ipreallocate
38 wait_until_ips_are_on_node $test_node $test_ip