1 # Hey Emacs, this is a -*- shell-script -*- !!! :-)
3 hdir="$CTDB_SCRIPTS_HELPER_BINDIR"
4 export CTDB_EVENT_HELPER="${hdir}/ctdb-event"
6 if $CTDB_TESTS_ARE_INSTALLED ; then
8 helper="ctdb_local_daemons"
10 helper="${CTDB_TEST_DIR}/local_daemons.sh"
13 ctdb_local_daemons="${helper} ${SIMPLE_TESTS_VAR_DIR}"
15 # onnode will execute this, which fakes ssh against local daemons
16 export ONNODE_SSH="${ctdb_local_daemons} ssh"
18 #######################################
22 local no_event_scripts=false
24 # All other options are passed through to local_daemons.sh setup
26 --no-event-scripts) no_event_scripts=true ; shift ;;
29 $ctdb_local_daemons setup "$@" \
30 -n "$TEST_LOCAL_DAEMONS" \
31 ${CTDB_USE_IPV6:+-6} \
32 ${TEST_SOCKET_WRAPPER_SO_PATH:+-S ${TEST_SOCKET_WRAPPER_SO_PATH}}
33 # Burying the above in an if-statement condition reduces readability.
34 # shellcheck disable=SC2181
35 if [ $? -ne 0 ] ; then
39 if $no_event_scripts ; then
41 for pnn in $(seq 0 $((TEST_LOCAL_DAEMONS - 1))) ; do
42 rm -vf "${CTDB_BASE}/events/legacy/"*
51 $ctdb_local_daemons start "$pnn"
56 $ctdb_local_daemons start "all"
63 $ctdb_local_daemons stop "$pnn"
68 $ctdb_local_daemons stop "all"
77 # onnode just needs the nodes file, so use the common one
78 export CTDB_BASE="$SIMPLE_TESTS_VAR_DIR"