summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:20:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:20:00 +0000
commit8daa83a594a2e98f39d764422bfbdbc62c9efd44 (patch)
tree4099e8021376c7d8c05bdf8503093d80e9c7bad0 /ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh
parentInitial commit. (diff)
downloadsamba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.tar.xz
samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.zip
Adding upstream version 2:4.20.0+dfsg.upstream/2%4.20.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh b/ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh
new file mode 100755
index 0000000..072780a
--- /dev/null
+++ b/ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Verify that a node's public IP address can be deleted using 'ctdb deleteip'.
+
+# This is an extended version of simple/17_ctdb_config_delete_ip.sh
+
+. "${TEST_SCRIPTS_DIR}/cluster.bash"
+
+set -e
+
+test_node_has_test_ip()
+{
+ # $test_node and $test_ip set by select_test_node_and_ips()
+ # shellcheck disable=SC2154
+ try_command_on_node "$test_node" "ip addr show to ${test_ip}"
+ [ -n "$out" ]
+}
+
+ctdb_test_init
+
+select_test_node_and_ips
+
+# $test_node and $test_ip set by select_test_node_and_ips()
+# shellcheck disable=SC2154
+echo "Checking that node ${test_node} hosts ${test_ip}..."
+test_node_has_test_ip
+
+echo "Attempting to remove ${test_ip} from node ${test_node}."
+ctdb_onnode "$test_node" "delip ${test_ip}"
+ctdb_onnode "$test_node" "ipreallocate"
+wait_until_ips_are_on_node '!' "$test_node" "$test_ip"
+
+echo "Waiting for ${test_ip} to disappear from node ${test_node}..."
+wait_until 60/5 '!' test_node_has_test_ip
+
+echo "GOOD: IP was successfully removed!"