. "${TEST_SCRIPTS_DIR}/common.sh"
-# common.sh will set TEST_SUBDIR to a stupid value when installed
-# because common.sh is usually sourced by a test. TEST_SUBDIR needs
-# to be correctly set so setup_ctdb_base() finds the etc-ctdb/
-# subdirectory and the test event script is correctly installed, so
-# fix it.
-# shellcheck disable=SC2034
-TEST_SUBDIR="$CTDB_TEST_DIR"
-
if ! $CTDB_TESTS_ARE_INSTALLED ; then
hdir="$CTDB_SCRIPTS_HELPER_BINDIR"
export CTDB_EVENTD="${hdir}/ctdb-eventd"
-n <num> Number of nodes (default: 3)
-P <file> Public addresses file (default: automatically generated)
-R Use a command for the recovery lock (default: use a file)
+ -r <time> Like -R and set recheck interval to <time> (default: use a file)
-S <library> Socket wrapper shared library to preload (default: none)
-6 Generate IPv6 IPs for nodes, public addresses (default: IPv4)
EOF
_num_nodes=3
_public_addresses_file=""
_recovery_lock_use_command=false
+ _recovery_lock_recheck_interval=""
_socket_wrapper=""
_use_ipv6=false
set -e
- while getopts "FN:n:P:RS:6h?" _opt ; do
+ while getopts "FN:n:P:Rr:S:6h?" _opt ; do
case "$_opt" in
F) _disable_failover=true ;;
N) _nodes_file="$OPTARG" ;;
n) _num_nodes="$OPTARG" ;;
P) _public_addresses_file="$OPTARG" ;;
R) _recovery_lock_use_command=true ;;
+ r) _recovery_lock_use_command=true
+ _recovery_lock_recheck_interval="$OPTARG"
+ ;;
S) _socket_wrapper="$OPTARG" ;;
6) _use_ipv6=true ;;
\?|h) local_daemons_setup_usage ;;
_recovery_lock="${directory}/rec.lock"
if $_recovery_lock_use_command ; then
_helper="${CTDB_SCRIPTS_HELPER_BINDIR}/ctdb_mutex_fcntl_helper"
- _recovery_lock="! ${_helper} ${_recovery_lock}"
+ _t="! ${_helper} ${_recovery_lock}"
+ if [ -n "$_recovery_lock_recheck_interval" ] ; then
+ _t="${_t} ${_recovery_lock_recheck_interval}"
+ fi
+ _recovery_lock="$_t"
fi
if [ -n "$_socket_wrapper" ] ; then
fi
for _n in $(seq 0 $((_num_nodes - 1))) ; do
- setup_ctdb_base "$directory" "node.${_n}" \
+ # CTDB_TEST_SUITE_DIR needs to be correctly set so
+ # setup_ctdb_base() finds the etc-ctdb/ subdirectory
+ # and the test event script is correctly installed
+ # shellcheck disable=SC2034
+ CTDB_TEST_SUITE_DIR="$CTDB_TEST_DIR" \
+ setup_ctdb_base "$directory" "node.${_n}" \
functions notify.sh debug-hung-script.sh
cp "$_nodes_all" "${CTDB_BASE}/nodes"
onnode_common
- onnode -p "$_nodes" "${VALGRIND:-} ${CTDB:-ctdb} shutdown"
+ onnode -p "$_nodes" "${CTDB:-${VALGRIND:-} ctdb} shutdown"
}
local_daemons_onnode_usage ()