tests: Complex tests must not be run from a cluster node
authorMartin Schwenke <martin@meltin.net>
Wed, 23 May 2012 05:36:01 +0000 (15:36 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 25 May 2012 04:48:03 +0000 (14:48 +1000)
Tickle tests fail if run from a node involved in the test.

The condition is actually weaker than this: the test can't be run from
a CTDB node that is hosting public addresses that may be used by the
test.

Rework ctdb_test_check_real_cluster() to support checking this.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/complex/scripts/local.bash

index e3cd431e6236da0adf44b29df8e1dfffa62682e3..0976c3f9de6f48f364b79f5e5534c38f63a9971c 100644 (file)
@@ -129,11 +129,12 @@ gratarp_sniff_wait_show ()
 
 ctdb_test_check_real_cluster ()
 {
-    if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
-       return 0
-    fi
+    [ -z "$TEST_LOCAL_DAEMONS" ] || \
+       die "ERROR: This test must be run against a real/virtual cluster, not local daemons."
 
-    echo "ERROR: This test must be run on a real/virtual cluster, not local daemons."
-    return 1
+    for i in $(onnode -q all hostname) ; do
+       [ "$h" != "$i" ] || \
+           die "ERROR: This test must not be run from a cluster node."
+    done
 }