From: Martin Schwenke Date: Tue, 3 Sep 2019 09:12:45 +0000 (+1000) Subject: ctdb-tests: Simplify setup_ctdb() X-Git-Tag: talloc-2.3.1~841 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2730e48360750d4fbfd66ea76a2b0f002acfcab9;p=thirdparty%2Fsamba.git ctdb-tests: Simplify setup_ctdb() 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 Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/simple/01_ctdb_reclock_command.sh b/ctdb/tests/simple/01_ctdb_reclock_command.sh index 34f82e981a1..1e1bb1b588f 100755 --- a/ctdb/tests/simple/01_ctdb_reclock_command.sh +++ b/ctdb/tests/simple/01_ctdb_reclock_command.sh @@ -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 diff --git a/ctdb/tests/simple/19_ip_takeover_noop.sh b/ctdb/tests/simple/19_ip_takeover_noop.sh index 93caf668c0b..d162f0e5fba 100755 --- a/ctdb/tests/simple/19_ip_takeover_noop.sh +++ b/ctdb/tests/simple/19_ip_takeover_noop.sh @@ -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 diff --git a/ctdb/tests/simple/scripts/local_daemons.bash b/ctdb/tests/simple/scripts/local_daemons.bash index 17aad307158..95af943f6d7 100644 --- a/ctdb/tests/simple/scripts/local_daemons.bash +++ b/ctdb/tests/simple/scripts/local_daemons.bash @@ -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