1 # Hey Emacs, this is a -*- shell-script -*- !!! :-)
3 if "$TEST_VERBOSE" ; then
4 debug
() { echo "$@" ; }
11 _f
=$
(basename "$0" ".sh")
16 _func
="${_func%.*}" # Strip test number
17 test_prog
="ctdb_functest ${_func}"
21 _cmd
="${_cmd%.*}" # Strip test number
22 test_prog
="ctdb_stubtest ${_cmd}"
25 die
"Unknown pattern for testcase \"$_f\""
28 printf "%-28s - %s\n" "$_f" "$1"
33 debug
"Setting up NAT gateway"
35 natgw_config_dir
="${TEST_VAR_DIR}/natgw_config"
36 mkdir
-p "$natgw_config_dir"
38 # These will accumulate, 1 per test... but will be cleaned up at
40 export CTDB_NATGW_NODES
=$
(mktemp
--tmpdir="$natgw_config_dir")
42 cat >"$CTDB_NATGW_NODES"
49 _v
="CTDB_NODES${_pnn:+_}${_pnn}"
50 debug
"Setting up ${_v}"
52 # These will accumulate, 1 per test... but will be cleaned up at
54 eval export "${_v}"=$
(mktemp
--tmpdir="$TEST_VAR_DIR")
59 # You can't be too careful about what might be in the
60 # environment... so clean up when setting the default variable.
61 if [ -z "$_pnn" ] ; then
62 _n
=$
(wc -l "$CTDB_NODES" |
awk '{ print $1 }')
63 for _i
in $
(seq 0 $_n) ; do
64 eval unset "CTDB_NODES_${_i}"
71 : ${CTDB_DEBUGLEVEL:=3}
72 export CTDB_DEBUGLEVEL
74 _out
=$
($VALGRIND $test_prog "$@" 2>&1)