summaryrefslogtreecommitdiff
path: root/ctdb/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb/tests')
-rwxr-xr-xctdb/tests/simple/18_ctdb_reloadips.sh37
1 files changed, 20 insertions, 17 deletions
diff --git a/ctdb/tests/simple/18_ctdb_reloadips.sh b/ctdb/tests/simple/18_ctdb_reloadips.sh
index 61c3a561da9..451fca3a866 100755
--- a/ctdb/tests/simple/18_ctdb_reloadips.sh
+++ b/ctdb/tests/simple/18_ctdb_reloadips.sh
@@ -29,8 +29,6 @@ cluster_is_healthy
select_test_node_and_ips
-echo "Emptying public addresses file on $test_node"
-
try_command_on_node $test_node $CTDB_TEST_WRAPPER ctdb_base_show
addresses="${out}/public_addresses"
echo "Public addresses file on node $test_node is \"$addresses\""
@@ -69,25 +67,31 @@ do_ctdb_reloadips ()
done
}
-try_command_on_node $test_node "mv $addresses $backup && touch $addresses"
+
+echo "Removing IP $test_ip from node $test_node"
+
+try_command_on_node $test_node "mv $addresses $backup && grep -v '^${test_ip}/' $backup >$addresses"
do_ctdb_reloadips
-echo "Getting list of public IPs on node $test_node"
-try_command_on_node $test_node "$CTDB ip | tail -n +2"
+try_command_on_node $test_node $CTDB ip
-if [ -n "$out" ] ; then
+if grep "^${test_ip} " <<<"$out" ; then
cat <<EOF
-BAD: node $test_node still has ips:
+BAD: node $test_node can still host IP $test_ip:
$out
EOF
exit 1
fi
-echo "GOOD: no IPs left on node $test_node"
+cat <<EOF
+GOOD: node $test_node is no longer hosting IP $test_ip:
+$out
+EOF
try_command_on_node any $CTDB sync
+
echo "Restoring addresses"
restore_public_addresses
@@ -108,23 +112,22 @@ EOF
try_command_on_node any $CTDB sync
-echo "Removing IP $test_ip from node $test_node"
-try_command_on_node $test_node "mv $addresses $backup && grep -v '^${test_ip}/' $backup >$addresses"
+echo "Emptying public addresses file on $test_node"
+
+try_command_on_node $test_node "mv $addresses $backup && touch $addresses"
do_ctdb_reloadips
-try_command_on_node $test_node $CTDB ip
+echo "Getting list of public IPs on node $test_node"
+try_command_on_node $test_node "$CTDB ip | tail -n +2"
-if grep "^${test_ip} " <<<"$out" ; then
+if [ -n "$out" ] ; then
cat <<EOF
-BAD: node $test_node can still host IP $test_ip:
+BAD: node $test_node still has ips:
$out
EOF
exit 1
fi
-cat <<EOF
-GOOD: node $test_node is no longer hosting IP $test_ip:
-$out
-EOF
+echo "GOOD: no IPs left on node $test_node"