ctdb-tests: Change all cluster setup to use ctdb_test_init()
authorMartin Schwenke <martin@meltin.net>
Mon, 8 Oct 2018 06:25:48 +0000 (17:25 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 6 Nov 2018 06:16:17 +0000 (07:16 +0100)
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>
ctdb/tests/scripts/integration.bash
ctdb/tests/simple/19_ip_takeover_noop.sh
ctdb/tests/simple/28_zero_eventscripts.sh

index 3434db91b6eeeaa80f15bb9900d35eb28f060127..6ba531a4a76ceeb05f5a0154a768923a5b9fe03b 100644 (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
index e0bbf0f09113566953ae4bf9b7a1c299d54d5ac2..8aedb339d94bf22ef9b4da466ae15638e4b7c9fd 100755 (executable)
@@ -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
index b9912f6551e01c451c7da0ea559a9cc8ca80e2e9..75e5e047a7372d05f6880b18576e2010b0848bdc 100755 (executable)
@@ -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