2 # usage: m1test <name> <initfile> [<initflags>] <queryargs>'
3 # test recording script
5 # This file is part of adns, which is Copyright Ian Jackson
6 # and contributors (see the file INSTALL for full details).
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software Foundation.
27 'usage: m1test <name> <initfile> [-<initflags>] ["<"]
28 [=<hrecord-command-args>] <queryargs>
29 ("<" means read input from case-<name>.in)'
33 case="$srcdir/case-$1"; shift
36 hrecord="./adnstest_record"
39 -*) initflags="$1"; shift
44 shift; exec <"$case.in"
48 =*) hrecord="`echo \"$1\" | sed -e 's/^=//'`"; shift
51 if test ! -f "$hrecord" -a -f "${hrecord}_record"
54 /*) program="$hrecord" ;;
55 *) program="./$hrecord" ;;
57 hrecord="${program}_record"
59 program="$(echo "$hrecord" | sed -e 's/ .*//; s/_record$//')"
64 initstring="`cat $srcdir/init-$initfile.text`"
65 xinitflagsf=$srcdir/$program-xinitflags.text
66 if test -e $xinitflagsf
68 useinitflags="$initflags $(cat $xinitflagsf)";
70 useinitflags="$initflags /"
73 echo $program $initfile $initflags >"$case.sys"
74 echo "$queryargs" >>"$case.sys"
77 export EF_DISABLE_BANNER
79 rm -f pipe.out pipe.err
82 tee <pipe.out "$case.out" &
84 tee <pipe.err "$case.err" &
89 echo running hrecord $initflags "... $queryargs"
91 ADNS_TEST_OUT_FD=3 3>>"$case.sys" >&4 2>&5 \
92 $hrecord $useinitflags"$initstring" $queryargs
103 echo "exit status: $rc"