chiark / gitweb /
5a8bbed5e27c67480ad589a7f49d7ffc9f05ff83
[adns.git] / regress / m1test
1 #!/bin/sh
2
3 set -e
4
5 if [ $# -lt 3 ]
6 then
7         echo >&2 'usage: m1test <name> <initfile> <queryargs>'
8         exit 1
9 fi
10
11 case="case-$1"; shift
12 initfile="$1"; shift
13 queryargs="$*"
14
15 initstring="`cat init-$initfile.text`"
16
17 echo "$initfile" >"$case.sys"
18 echo "$queryargs" >>"$case.sys"
19
20 echo running "hrecord /... $queryargs"
21 set +e
22 ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" </dev/null \
23  ./hrecord "/$initstring" $queryargs
24 rc=$?
25 set -e
26
27 egrep . -- "$case.err" "$case.out"
28 echo "exit status: $rc"
29
30 if test $rc = 0
31 then
32         echo "test created ok"
33 fi
34
35 exit $rc