From: Martin Schwenke Date: Wed, 18 Sep 2019 01:43:53 +0000 (+1000) Subject: ctdb-tests: Add function ctdb_test_skip_on_cluster() X-Git-Tag: talloc-2.3.1~495 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ad356c282044db251c395db06900b249ff07544;p=thirdparty%2Fsamba.git ctdb-tests: Add function ctdb_test_skip_on_cluster() Use it in relevant tests. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/INTEGRATION/failover/pubips.013.failover_noop.sh b/ctdb/tests/INTEGRATION/failover/pubips.013.failover_noop.sh index d162f0e5fba..0c6fd833a5e 100755 --- a/ctdb/tests/INTEGRATION/failover/pubips.013.failover_noop.sh +++ b/ctdb/tests/INTEGRATION/failover/pubips.013.failover_noop.sh @@ -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 diff --git a/ctdb/tests/INTEGRATION/simple/cluster.012.reclock_command.sh b/ctdb/tests/INTEGRATION/simple/cluster.012.reclock_command.sh index 1e1bb1b588f..8199b079610 100755 --- a/ctdb/tests/INTEGRATION/simple/cluster.012.reclock_command.sh +++ b/ctdb/tests/INTEGRATION/simple/cluster.012.reclock_command.sh @@ -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 diff --git a/ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh b/ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh index 5329b49b23a..fccc802b370 100755 --- a/ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh +++ b/ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh @@ -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 diff --git a/ctdb/tests/INTEGRATION/simple/eventscripts.001.zero_scripts.sh b/ctdb/tests/INTEGRATION/simple/eventscripts.001.zero_scripts.sh index 2e536da5e6a..4e55319000e 100755 --- a/ctdb/tests/INTEGRATION/simple/eventscripts.001.zero_scripts.sh +++ b/ctdb/tests/INTEGRATION/simple/eventscripts.001.zero_scripts.sh @@ -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 diff --git a/ctdb/tests/INTEGRATION/simple/eventscripts.090.debug_hung.sh b/ctdb/tests/INTEGRATION/simple/eventscripts.090.debug_hung.sh index af045cf785e..9a42af80946 100755 --- a/ctdb/tests/INTEGRATION/simple/eventscripts.090.debug_hung.sh +++ b/ctdb/tests/INTEGRATION/simple/eventscripts.090.debug_hung.sh @@ -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 diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index c8a1b760835..51eceb59dc6 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -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