summaryrefslogtreecommitdiff
path: root/ctdb/tests
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-08-01 16:00:55 +1000
committerMartin Schwenke <martins@samba.org>2016-08-18 02:50:15 +0200
commit2fd20cfd8515ab8c047149fdcbf5471d8c58a0af (patch)
treeeba19c2053125e080a710ec47ce0f5fc04e26521 /ctdb/tests
parent59b6f8f13961503da14410b5318aeb31d94cd917 (diff)
downloadsamba-2fd20cfd8515ab8c047149fdcbf5471d8c58a0af.tar.gz
ctdb-tests: Validate that TAKE_IP works with IP already on an interface
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Aug 18 02:50:16 CEST 2016 on sn-devel-144
Diffstat (limited to 'ctdb/tests')
-rwxr-xr-xctdb/tests/complex/61_rogueip_takeip.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/ctdb/tests/complex/61_rogueip_takeip.sh b/ctdb/tests/complex/61_rogueip_takeip.sh
new file mode 100755
index 00000000000..1c087f6391d
--- /dev/null
+++ b/ctdb/tests/complex/61_rogueip_takeip.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+test_info()
+{
+ cat <<EOF
+Verify that TAKE_IP will work for an IP that is already on an interface
+
+This is a variation of simple/60_recoverd_missing_ip.sh
+EOF
+}
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+ctdb_test_init "$@"
+
+set -e
+
+cluster_is_healthy
+
+# Reset configuration
+ctdb_restart_when_done
+
+select_test_node_and_ips
+
+echo "Running test against node $test_node and IP $test_ip"
+
+get_test_ip_mask_and_iface
+
+echo "Deleting IP $test_ip from all nodes"
+delete_ip_from_all_nodes $test_ip
+try_command_on_node -v $test_node $CTDB ipreallocate
+wait_until_ips_are_on_node ! $test_node $test_ip
+
+try_command_on_node -v all $CTDB ip
+
+# The window here needs to small, to try to avoid the address being
+# released. The test will still pass either way but if the first IP
+# takeover run does a release then this doesn't test the code path we
+# expect it to...
+echo "Adding IP $test_ip to $iface and CTDB on node $test_node"
+ip_cmd="ip addr add $test_ip/$mask dev $iface"
+ctdb_cmd="$CTDB addip $test_ip/$mask $iface && $CTDB ipreallocate"
+try_command_on_node $test_node "$ip_cmd && $ctdb_cmd"
+
+wait_until_ips_are_on_node $test_node $test_ip