1
# Hey Emacs, this is a -*- shell-script -*- !!! :-)
3
# Print a message and exit.
4
die () { echo "$@" >&2 ; exit 1 ; }
6
test_prog="$(dirname ${TAKEOVER_TESTS_DIR})/bin/ctdb_takeover_tests ctdb_takeover_run_core"
11
_f="${_f#./}" # strip leading ./
12
_f="${_f#testcases/}" # strip leading testcases/
13
_f="${_f%.sh}" # strip off .sh suffix if any
22
export CTDB_LCP2="yes"
25
die "Unknown algorithm for testcase \"$_f\""
28
printf "%-12s - %s\n" "$_f" "$1"
34
required_output=$(cat)
40
_out=$($test_prog $_states 2>&1)
43
if [ "$algorithm" = "lcp2" -a -n "$CTDB_TEST_LOGLEVEL" ] ; then
44
OUT_FILTER='s@^.*:@DATE TIME \[PID\]:@'
47
if [ -n "$OUT_FILTER" ] ; then
48
_fout=$(echo "$_out" | sed -r "$OUT_FILTER")
53
if [ "$_fout" = "$required_output" -a $_rc = $required_rc ] ; then
59
##################################################
60
Required output (Exit status: ${required_rc}):
61
##################################################
63
##################################################
64
Actual output (Exit status: ${_rc}):
65
##################################################