1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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>
This commit is contained in:
Martin Schwenke 2018-10-08 17:25:48 +11:00 committed by Amitay Isaacs
parent 9a2910c60b
commit 2cb82ef453
3 changed files with 7 additions and 28 deletions

View File

@ -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

View File

@ -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

View File

@ -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