1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00
samba-mirror/ctdb/tests/complex/11_ctdb_delip_removes_ip.sh
Martin Schwenke 066cc5b0c5 ctdb-tests: Avoid bulk output in $out, prefer $outfile
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-05-07 05:45:35 +00:00

53 lines
1.1 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
select_test_node_and_ips
get_test_ip_mask_and_iface
echo "Checking that node ${test_node} hosts ${test_ip}..."
try_command_on_node $test_node "ip addr show to ${test_ip} | grep -q ."
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 node ${test_node}..."
while : ; do
try_command_on_node -v $test_node "ip addr show to ${test_node}"
if -n "$out" ; 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!"