From: Martin Schwenke Date: Mon, 8 Oct 2018 06:25:48 +0000 (+1100) Subject: ctdb-tests: Change all cluster setup to use ctdb_test_init() X-Git-Tag: tdb-1.3.17~879 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cb82ef4533a7c10a0ccac5df36f7176f78f9e7b;p=thirdparty%2Fsamba.git ctdb-tests: Change all cluster setup to use ctdb_test_init() ctdb_test_init() now passes any arguments to setup_ctdb(). Update tests that have custom local daemon configuration to call ctdb_test_init() directly. Remove the redundant, initial call to ctdb_test_init() to avoid starting the cluster an extra time. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index 3434db91b6e..6ba531a4a76 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -62,7 +62,7 @@ ctdb_test_init () ctdb_stop_all >/dev/null 2>&1 || true echo "Configuring cluster..." - setup_ctdb || exit 1 + setup_ctdb "$@" || exit 1 echo "Starting cluster..." ctdb_init || exit 1 diff --git a/ctdb/tests/simple/19_ip_takeover_noop.sh b/ctdb/tests/simple/19_ip_takeover_noop.sh index e0bbf0f0911..8aedb339d94 100755 --- a/ctdb/tests/simple/19_ip_takeover_noop.sh +++ b/ctdb/tests/simple/19_ip_takeover_noop.sh @@ -15,26 +15,17 @@ EOF . "${TEST_SCRIPTS_DIR}/integration.bash" -ctdb_test_init - set -e -cluster_is_healthy - if [ -z "$TEST_LOCAL_DAEMONS" ] ; then echo "SKIPPING this test - only runs against local daemons" exit 0 fi -select_test_node_and_ips - -ctdb_stop_all - echo "Starting CTDB with failover disabled..." -setup_ctdb --disable-failover -ctdb_start_all +ctdb_test_init --disable-failover -wait_until_ready +cluster_is_healthy echo "Getting IP allocation..." try_command_on_node -v any "$CTDB ip all | tail -n +2" @@ -50,13 +41,11 @@ EOF echo "GOOD: All IP addresses are unassigned" echo "----------------------------------------" -ctdb_stop_all echo "Starting CTDB with an empty public addresses configuration..." -setup_ctdb --no-public-addresses -ctdb_start_all +ctdb_test_init --no-public-addresses -wait_until_ready +cluster_is_healthy echo "Trying explicit ipreallocate..." try_command_on_node any $CTDB ipreallocate diff --git a/ctdb/tests/simple/28_zero_eventscripts.sh b/ctdb/tests/simple/28_zero_eventscripts.sh index b9912f6551e..75e5e047a73 100755 --- a/ctdb/tests/simple/28_zero_eventscripts.sh +++ b/ctdb/tests/simple/28_zero_eventscripts.sh @@ -12,25 +12,15 @@ EOF . "${TEST_SCRIPTS_DIR}/integration.bash" -ctdb_test_init - set -e -cluster_is_healthy - if [ -z "$TEST_LOCAL_DAEMONS" ] ; then echo "SKIPPING this test - only runs against local daemons" exit 0 fi -ctdb_stop_all +ctdb_test_init --no-event_scripts -echo "Starting CTDB with an empty eventscript directory..." -setup_ctdb --no-event-scripts -ctdb_start_all - -wait_until_ready +cluster_is_healthy echo "Good, that seems to work!" - -ctdb_stop_all