diff options
author | Martin Schwenke <martin@meltin.net> | 2019-09-05 14:01:20 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2019-09-26 04:45:37 +0000 |
commit | df6800e330d1c1fd47ce3d2f7a5814597ed46229 (patch) | |
tree | 9f9474e7838ab3b4fcdb0a573e7a3af79c675b7c /ctdb/tests/scripts/integration.bash | |
parent | 384381fbff5ca900af031fb0606a270f572f5b9e (diff) | |
download | samba-df6800e330d1c1fd47ce3d2f7a5814597ed46229.tar.gz |
ctdb-tests: Convert local daemons include file into top-level include
Do the same with the alternative code for real clusters.
Both of these can now be used by other test suites.
Fix some basic shellcheck warnings (e.g. avoid word-splitting by
quoting) while moving code and add the new files to the shellcheck
test.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests/scripts/integration.bash')
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 68 |
1 files changed, 7 insertions, 61 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index 3a11ebbc0ce..9142cf5701c 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -485,47 +485,6 @@ wait_until_node_has_no_ips () ####################################### -_service_ctdb () -{ - cmd="$1" - - if [ -e /etc/redhat-release ] ; then - service ctdb "$cmd" - else - /etc/init.d/ctdb "$cmd" - fi -} - -# Stop/start CTDB on all nodes. Override for local daemons. -ctdb_stop_all () -{ - onnode -p all $CTDB_TEST_WRAPPER _service_ctdb stop -} -ctdb_start_all () -{ - onnode -p all $CTDB_TEST_WRAPPER _service_ctdb start -} - -setup_ctdb () -{ - ctdb_enable_cluster_test_event_scripts -} - -start_ctdb_1 () -{ - onnode "$1" $CTDB_TEST_WRAPPER _service_ctdb start -} - -stop_ctdb_1 () -{ - onnode "$1" $CTDB_TEST_WRAPPER _service_ctdb stop -} - -restart_ctdb_1 () -{ - onnode "$1" $CTDB_TEST_WRAPPER _service_ctdb restart -} - ctdb_init () { local i @@ -698,31 +657,18 @@ db_ctdb_tstore_dbseqnum () db_ctdb_tstore $1 "$2" "$_key" "$_value" } -####################################### - -# Enables all of the event scripts used in cluster tests, except for -# the mandatory scripts -ctdb_enable_cluster_test_event_scripts () -{ - local scripts=" - 06.nfs - 10.interface - 49.winbind - 50.samba - 60.nfs - " - - local s - for s in $scripts ; do - try_command_on_node all ctdb event script enable legacy "$s" - done -} - ######################################## # Make sure that $CTDB is set. : ${CTDB:=ctdb} +if [ -z "$TEST_LOCAL_DAEMONS" ] ; then + . "${TEST_SCRIPTS_DIR}/integration_real_cluster.bash" +else + . "${TEST_SCRIPTS_DIR}/integration_local_daemons.bash" +fi + + local="${CTDB_TEST_SUITE_DIR}/scripts/local.bash" if [ -r "$local" ] ; then . "$local" |