Use it in relevant tests.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
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
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
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
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
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
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