]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Simplify setup_ctdb()
authorMartin Schwenke <martin@meltin.net>
Tue, 3 Sep 2019 09:12:45 +0000 (19:12 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 17 Sep 2019 04:35:26 +0000 (04:35 +0000)
There is no point inventing a whole new set of options here.

Continue to locally implement the --no-event-scripts option.  This
must be first, though in practice only one option is ever passed to
setup_ctdb() from ctdb_test_init().

Simply pass all other options through to "local_daemons.sh setup".
This has the side effect of causing failure when an invalid option is
passed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/simple/01_ctdb_reclock_command.sh
ctdb/tests/simple/19_ip_takeover_noop.sh
ctdb/tests/simple/scripts/local_daemons.bash

index 34f82e981a187b32111377a1f48afd01d82d1761..1e1bb1b588f9013b48c976e8d4e452c986150e54 100755 (executable)
@@ -21,7 +21,7 @@ if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
 fi
 
 echo "Starting CTDB with recovery lock command configured..."
-ctdb_test_init --reclock-use-command
+ctdb_test_init -R
 
 cluster_is_healthy
 
index 93caf668c0bc80ea46c91483b2ac7a65457e7bfc..d162f0e5fba96fb5e388df2043f1a5746bfd9ae4 100755 (executable)
@@ -23,7 +23,7 @@ if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
 fi
 
 echo "Starting CTDB with failover disabled..."
-ctdb_test_init --disable-failover
+ctdb_test_init -F
 
 cluster_is_healthy
 
@@ -41,7 +41,7 @@ echo "GOOD: All IP addresses are unassigned"
 echo "----------------------------------------"
 
 echo "Starting CTDB with an empty public addresses configuration..."
-ctdb_test_init --no-public-addresses
+ctdb_test_init -P /dev/null
 
 cluster_is_healthy
 
index 17aad30715858f56a903ab37957be80c4c84bdae..95af943f6d79daa7004a87c58f6935163a4410bf 100644 (file)
@@ -19,23 +19,16 @@ export ONNODE_SSH="${ctdb_local_daemons} ssh"
 
 setup_ctdb ()
 {
-       local public_addresses=""
        local no_event_scripts=false
-       local disable_failover=""
-       local reclock_use_command=""
+
+       # All other options are passed through to local_daemons.sh setup
        case "$1" in
-       --no-public-addresses) public_addresses="/dev/null" ;;
-       --no-event-scripts)    no_event_scripts=true    ;;
-       --disable-failover)    disable_failover="yes"   ;;
-       --reclock-use-command) reclock_use_command="yes" ;;
+       --no-event-scripts) no_event_scripts=true ; shift ;;
        esac
 
-       $ctdb_local_daemons setup \
+       $ctdb_local_daemons setup "$@" \
                -n "$TEST_LOCAL_DAEMONS" \
-               ${disable_failover:+-F} \
-               ${public_addresses:+-P} ${public_addresses} \
                ${CTDB_USE_IPV6:+-6} \
-               ${reclock_use_command:+-R} \
                ${TEST_SOCKET_WRAPPER_SO_PATH:+-S ${TEST_SOCKET_WRAPPER_SO_PATH}}
        # Burying the above in an if-statement condition reduces readability.
        # shellcheck disable=SC2181