summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctdb/tests/scripts/ctdb_test_functions.bash24
-rwxr-xr-xctdb/tests/simple/32_ctdb_enable.sh11
-rwxr-xr-xctdb/tests/simple/42_ctdb_continue.sh10
3 files changed, 32 insertions, 13 deletions
diff --git a/ctdb/tests/scripts/ctdb_test_functions.bash b/ctdb/tests/scripts/ctdb_test_functions.bash
index 4f05888d4a..42053c0486 100644
--- a/ctdb/tests/scripts/ctdb_test_functions.bash
+++ b/ctdb/tests/scripts/ctdb_test_functions.bash
@@ -482,6 +482,30 @@ wait_until_ips_are_on_nodeglob ()
wait_until 60 ips_are_on_nodeglob "$@"
}
+node_has_some_ips ()
+{
+ local node="$1"
+
+ local out
+
+ all_ips_on_node 1
+
+ while read ip pnn ; do
+ if [ "$node" = "$pnn" ] ; then
+ return 0
+ fi
+ done <<<"$out" # bashism to avoid problem setting variable in pipeline.
+
+ return 1
+}
+
+wait_until_node_has_some_ips ()
+{
+ echo "Waiting for node to have some IPs..."
+
+ wait_until 60 node_has_some_ips "$@"
+}
+
get_src_socket ()
{
local proto="$1"
diff --git a/ctdb/tests/simple/32_ctdb_enable.sh b/ctdb/tests/simple/32_ctdb_enable.sh
index 4c1026e54b..d0698f8098 100755
--- a/ctdb/tests/simple/32_ctdb_enable.sh
+++ b/ctdb/tests/simple/32_ctdb_enable.sh
@@ -23,8 +23,7 @@ Steps:
failed over to other nodes.
5. Enable the disabled node using 'ctdb enable -n '<node>'.
6. Verify that the status changes back to 'OK'.
-7. Verify that the public IP addreses served by the disabled node are
- failed back to the node.
+7. Verify that some public IP addreses are failed back to the node.
Expected results:
@@ -63,11 +62,9 @@ try_command_on_node 1 $CTDB enable -n $test_node
wait_until_node_has_status $test_node enabled
-# BUG: this is only guaranteed if DeterministicIPs is 1 and
-# NoIPFailback is 0.
-if wait_until_ips_are_on_nodeglob "$test_node" $test_node_ips ; then
- echo "All IPs moved."
+if wait_until_node_has_some_ips "$test_node" ; then
+ echo "OK."
else
- echo "Some IPs didn't move."
+ echo "No IPs moved to node $test_node."
testfailures=1
fi
diff --git a/ctdb/tests/simple/42_ctdb_continue.sh b/ctdb/tests/simple/42_ctdb_continue.sh
index b472420ac8..fffcb9e433 100755
--- a/ctdb/tests/simple/42_ctdb_continue.sh
+++ b/ctdb/tests/simple/42_ctdb_continue.sh
@@ -23,7 +23,7 @@ Steps:
the node are failed over to one of the other nodes.
5. Use 'ctdb continue' to bring the node back online.
6. Verify that the status of the node changes back to 'OK' and that
- the public IP addresses move back to the node.
+ some public IP addresses move back to the node.
Expected results:
@@ -61,11 +61,9 @@ try_command_on_node 1 $CTDB continue -n $test_node
wait_until_node_has_status $test_node notstopped
-# BUG: this is only guaranteed if DeterministicIPs is 1 and
-# NoIPFailback is 0.
-if wait_until_ips_are_on_nodeglob "$test_node" $ips ; then
- echo "All IPs moved."
+if wait_until_no de_has_some_ips "$test_node" ; then
+ echo "OK."
else
- echo "Some IPs didn't move."
+ echo "No IPs moved to node $test_node."
testfailures=1
fi