summaryrefslogtreecommitdiffhomepage
path: root/adns-0.6/regress/r1test
blob: de8db693792b16d66d7f659d0ec9b55d3e4c629f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
# usage: r1test <testcasename>

set -e
mrc=1
trap 'exit $mrc' 0

casename="$1"
case="case-$casename"
ocase="output-$casename"

exec <"$case.sys"
read initfile initflags
read queryargs

initstring="`cat init-$initfile.text`"

rm -f $ocase.*

EF_DISABLE_BANNER=1
export EF_DISABLE_BANNER

set +e
ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
 ./hplayback $initflags "/$initstring" $queryargs
rc=$?
set -e

if [ "$rc" = 5 ]
then
	echo -n "SKIPPED-$casename "
	mrc=5
	exit
fi

echo "rc=$rc" >>$ocase.out

failed=false
for part in err out
do
	if diff -u -- "$case.$part" "$ocase.$part"
	then
		:
	else
		failed=true
	fi
done

if $failed
then
	echo >&2 "FAILED $case - WRONG OUTPUT - lines of syscall remaining `wc -l`"
	mrc=2
	exit
fi

echo -n "$casename "
mrc=0