diff options
author | Martin Schwenke <martin@meltin.net> | 2018-10-08 17:25:48 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2018-11-06 07:16:17 +0100 |
commit | 2cb82ef4533a7c10a0ccac5df36f7176f78f9e7b (patch) | |
tree | c81219f96dfbcf762f1c3c7bfd888fc5e598d1fc /ctdb | |
parent | 9a2910c60b0ae3f6bccf133ae210a7c4b9f1a7fc (diff) | |
download | samba-2cb82ef4533a7c10a0ccac5df36f7176f78f9e7b.tar.gz |
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 2 | ||||
-rwxr-xr-x | ctdb/tests/simple/19_ip_takeover_noop.sh | 19 | ||||
-rwxr-xr-x | ctdb/tests/simple/28_zero_eventscripts.sh | 14 |
3 files changed, 7 insertions, 28 deletions
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 |