summaryrefslogtreecommitdiff
path: root/ctdb/tests/takeover
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-04-18 10:37:45 +1000
committerMartin Schwenke <martin@meltin.net>2012-04-18 10:37:45 +1000
commit116f19b808ace4a74bcf56a638923dcd1e1e975d (patch)
tree7ede5873ee56d35ac12483e44a365438acb9e171 /ctdb/tests/takeover
parent6e05811c28730e604c4ef7dab4b701214f61e51a (diff)
downloadsamba-116f19b808ace4a74bcf56a638923dcd1e1e975d.tar.gz
tests: More unit test factoring/rationalisation and bug fixes
Move some options from eventscripts/run_tests.sh to scripts/run_tests. Remove the former. Move some functions from eventscripts/scripts/local.sh to scripts/unit.sh. Both of these are modified during move so they are no longer eventscript-specific. Tweak */local.sh so that the new functions in unit.sh are used. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7ff485687891732074c9fc9998502ca197663d02)
Diffstat (limited to 'ctdb/tests/takeover')
-rw-r--r--ctdb/tests/takeover/scripts/local.sh32
1 files changed, 5 insertions, 27 deletions
diff --git a/ctdb/tests/takeover/scripts/local.sh b/ctdb/tests/takeover/scripts/local.sh
index 0e6230ab6fc..ba46ef26514 100644
--- a/ctdb/tests/takeover/scripts/local.sh
+++ b/ctdb/tests/takeover/scripts/local.sh
@@ -24,35 +24,13 @@ define_test ()
simple_test ()
{
- _states="$1"
- _out=$($test_prog $_states 2>&1)
- _rc=$?
-
+ # Do some filtering of the output to replace date/time.
if [ "$algorithm" = "lcp2" -a -n "$CTDB_TEST_LOGLEVEL" ] ; then
- OUT_FILTER='s@^.*:@DATE TIME \[PID\]:@'
- fi
-
- if [ -n "$OUT_FILTER" ] ; then
- _fout=$(echo "$_out" | sed -r "$OUT_FILTER")
- else
- _fout="$_out"
+ OUT_FILTER='s@^.*:@DATE\ TIME\ \[PID\]:@'
fi
- if [ "$_fout" = "$required_output" -a $_rc = $required_rc ] ; then
- echo "PASSED"
- else
- cat <<EOF
-Algorithm: $algorithm
+ _states="$1"
+ _out=$($test_prog $_states 2>&1)
-##################################################
-Required output (Exit status: ${required_rc}):
-##################################################
-$required_output
-##################################################
-Actual output (Exit status: ${_rc}):
-##################################################
-$_out
-EOF
- return 1
- fi
+ result_check "Algorithm: $algorithm"
}