chiark / gitweb /
Add test for TCP responses which end up in several packets.
[adns.git] / regress / r1test
1 #!/bin/sh
2 # usage: r1test <testcasename>
3
4 set -e
5 mrc=1
6 trap 'exit $mrc' 0
7
8 casename="$1"
9 case="case-$casename"
10 ocase="output-$casename"
11
12 exec <"$case.sys"
13 read initfile initflags
14 read queryargs
15
16 initstring="`cat init-$initfile.text`"
17
18 rm -f $ocase.*
19
20 set +e
21 ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
22  ./hplayback $initflags "/$initstring" $queryargs
23 rc=$?
24 set -e
25
26 if [ "$rc" = 5 ]
27 then
28         echo -n "SKIPPED-$casename "
29         mrc=5
30         exit
31 fi
32
33 echo "rc=$rc" >>$ocase.out
34
35 failed=false
36 for part in err out
37 do
38         if diff -u -- "$case.$part" "$ocase.$part"
39         then
40                 :
41         else
42                 failed=true
43         fi
44 done
45
46 if $failed
47 then
48         echo >&2 "FAILED $case - WRONG OUTPUT - lines of syscall remaining `wc -l`"
49         mrc=2
50         exit
51 fi
52
53 echo -n "$casename "
54 mrc=0