summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/scripts
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2010-08-05 15:58:56 +1000
committerMartin Schwenke <martin@meltin.net>2010-08-05 15:58:56 +1000
commit77ad2be488c859795f721f87f04def8488dfbce5 (patch)
treeff5a0f9e32db5640bca8de9da8ef77c0ef42f6a6 /ctdb/tests/scripts
parentb930c885b3cfc95355bc29af4e4f5e31890bd275 (diff)
Test suite: weaken ctdb continue/enable tests for non-deterministic IPs.
These tests currently wait for the old IPs to fail back to the test node. This isn't guaranteed with DeterministicIPs disabled. This changes those tests to wait until the test node gets at least 1 IP assigned. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e9b3f5b1b51d541a911a27eb4348b368f28d185e)
Diffstat (limited to 'ctdb/tests/scripts')
-rw-r--r--ctdb/tests/scripts/ctdb_test_functions.bash24
1 files changed, 24 insertions, 0 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"