ctdb-tests: Add function ctdb_test_skip_on_cluster()
authorMartin Schwenke <martin@meltin.net>
Wed, 18 Sep 2019 01:43:53 +0000 (11:43 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 4 Oct 2019 09:41:28 +0000 (09:41 +0000)
Use it in relevant tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/INTEGRATION/failover/pubips.013.failover_noop.sh
ctdb/tests/INTEGRATION/simple/cluster.012.reclock_command.sh
ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh
ctdb/tests/INTEGRATION/simple/eventscripts.001.zero_scripts.sh
ctdb/tests/INTEGRATION/simple/eventscripts.090.debug_hung.sh
ctdb/tests/scripts/integration.bash

index d162f0e5fba96fb5e388df2043f1a5746bfd9ae4..0c6fd833a5e93e62b28b74f46484449628506fd1 100755 (executable)
@@ -17,10 +17,7 @@ EOF
 
 set -e
 
-if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
-       echo "SKIPPING this test - only runs against local daemons"
-       exit 0
-fi
+ctdb_test_skip_on_cluster
 
 echo "Starting CTDB with failover disabled..."
 ctdb_test_init -F
index 1e1bb1b588f9013b48c976e8d4e452c986150e54..8199b079610b51434faba682c482e9aa963652b1 100755 (executable)
@@ -15,10 +15,7 @@ EOF
 
 set -e
 
-if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
-       echo "SKIPPING this test - only runs against local daemons"
-       exit 0
-fi
+ctdb_test_skip_on_cluster
 
 echo "Starting CTDB with recovery lock command configured..."
 ctdb_test_init -R
index 5329b49b23ac5397aff7d68b94ef9e19ce0b57e9..fccc802b3701e55991ecaa5f4f21b46ee11b7a00 100755 (executable)
@@ -11,10 +11,7 @@ EOF
 
 set -e
 
-if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
-       echo "SKIPPING this test - only runs against local daemons"
-       exit 0
-fi
+ctdb_test_skip_on_cluster
 
 ctdb_test_init
 
index 2e536da5e6a79c35e73e317d28feafec3cd87560..4e55319000e93e9c30430e9d889b5665b70fa51f 100755 (executable)
@@ -14,10 +14,7 @@ EOF
 
 set -e
 
-if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
-       echo "SKIPPING this test - only runs against local daemons"
-       exit 0
-fi
+ctdb_test_skip_on_cluster
 
 ctdb_test_init --no-event-scripts
 
index af045cf785ec2769f7fb7c6bb20b90c0e6bd0a6f..9a42af809460515ec78617b1a5a671b228596b5a 100755 (executable)
@@ -19,15 +19,12 @@ EOF
 
 set -e
 
+ctdb_test_skip_on_cluster
+
 ctdb_test_init
 
 cluster_is_healthy
 
-if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
-       echo "SKIPPING this test - only runs against local daemons"
-       exit 0
-fi
-
 # This is overkill but it at least provides a valid test node
 select_test_node_and_ips
 
index c8a1b760835d0403d321d8a791b8eb1df56014dd..51eceb59dc62e22624b32fa045930ca56684ce29 100644 (file)
@@ -75,6 +75,14 @@ ctdb_test_init ()
        echo  "*** SETUP COMPLETE AT $(date '+%F %T'), RUNNING TEST..."
 }
 
+ctdb_test_skip_on_cluster ()
+{
+       if ctdb_test_on_cluster ; then
+               ctdb_test_skip \
+                       "SKIPPING this test - only runs against local daemons"
+       fi
+}
+
 ########################################
 
 # Sets: $out, $outfile