1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/ctdb/tests/complex/11_ctdb_delip_removes_ip.sh
Martin Schwenke 87b49c913f ctdb-daemon: Deletion of IPs is deferred until the next takeover run
This drastically simplifies the code.  "ctdb reloadips" behaves the
same, since it causes a takeover run immediately after IPs are
deleted.  "ctdb delip" now needs to be followed with an explicit "ctdb
ipreallocate".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-28 05:00:17 +02:00

56 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
test_info()
{
cat <<EOF
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
EOF
}
. "${TEST_SCRIPTS_DIR}/integration.bash"
set -e
ctdb_test_init "$@"
ctdb_test_check_real_cluster
cluster_is_healthy
# Reset configuration
ctdb_restart_when_done
select_test_node_and_ips
get_test_ip_mask_and_iface
echo "Checking that node ${test_node} hosts ${test_ip} on interface ${iface}..."
try_command_on_node $test_node "ip addr show dev $iface | grep -E 'inet6?[[:space:]]*${test_ip}/'"
echo "Attempting to remove ${test_ip} from node ${test_node}."
try_command_on_node $test_node $CTDB delip $test_ip
try_command_on_node $test_node $CTDB ipreallocate
wait_until_ips_are_on_node '!' $test_node $test_ip
timeout=60
increment=5
count=0
echo "Waiting for ${test_ip} to disappear from ${iface}..."
while : ; do
try_command_on_node -v $test_node "ip addr show dev $iface"
if echo "$out" | grep -E 'inet6?[[:space:]]*${test_ip}/'; then
echo "Still there..."
if [ $(($count * $increment)) -ge $timeout ] ; then
echo "BAD: Timed out waiting..."
exit 1
fi
sleep_for $increment
count=$(($count + 1))
else
break
fi
done
echo "GOOD: IP was successfully removed!"