X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=regress%2Fm1test;h=81b46345a4b00f11148941fc86ac9eb7a82a905c;hb=1674b67241faf969d9148eca8148a82d2ad540c3;hp=361e5b17106d5a274dcfaf9ad3c3306d385eab37;hpb=12c5b204145993a34b92ac2b7de5ebcebb6d2d15;p=adns.git diff --git a/regress/m1test b/regress/m1test index 361e5b1..81b4634 100755 --- a/regress/m1test +++ b/regress/m1test @@ -1,16 +1,69 @@ #!/bin/sh -# usage: m1test +# usage: m1test [] ' +# test recording script +# +# This file is +# Copyright (C) 1998-2000 Ian Jackson +# +# It is part of adns, which is +# Copyright (C) 1997-2000 Ian Jackson +# Copyright (C) 1999 Tony Finch +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. set -e -tcn="$1" -initfile="$2" + +if [ $# -lt 3 ] +then + echo >&2 \ +'usage: m1test [] [=] + ' + exit 1 +fi + +case="case-$1"; shift +initfile="$1"; shift + +hrecord="./hrecord" + +case "$1" in +-*) initflags="$1"; shift +esac + +case "$1" in +=*) hrecord="`echo \"$1\" | sed -e 's/^=//'`"; shift +esac + queryargs="$*" -test -d ../testcases || cd testcases -initstring="`cat $initfile.init`" +initstring="`cat init-$initfile.text`" + +echo $initfile $initflags >"$case.sys" +echo "$queryargs" >>"$case.sys" + +EF_DISABLE_BANNER=1 +export EF_DISABLE_BANNER + +echo running hrecord $initflags "/... $queryargs" +set +e +ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" $tcn.log -echo "$initfile" -echo "$queryargs" +echo "rc=$rc" >>$case.out -H../hrecord "/$initstring" $queryargs +egrep . -- "$case.err" "$case.out" +echo "exit status: $rc"