chiark / gitweb /
+ General Improvements:
authorian <ian>
Sat, 16 Sep 2000 17:35:01 +0000 (17:35 +0000)
committerian <ian>
Sat, 16 Sep 2000 17:35:01 +0000 (17:35 +0000)
@@ -3,6 +3,11 @@
   Bugfixes:
   * Actually compile shared libraries by default !

+  General Improvements:
+  * adnshost has --config option for overriding configuration.
+  * Regression tests now include `adnshost' invocations.
+  * Test cancellation both before and after query completion.
+
   Portability fixes:
   * Fix <sys/fcntl.h> in client/adnsresfilter.c to <fcntl.h>.
   * #include <sys/types.h> and <unistd.h> for fcntl in */*.c.
@@ -12,6 +17,7 @@
   * adnstest: setvbuf(stdout,...) before we do first output.
   * Cast a sizeof(...) in src/event.c to unsigned long before printing.
   * #include <sys/select.h> if it exists.
+  * Regression tests work better if some syscalls are already macros.

   Portability cleanups:
   * Add list of tested platforms in INSTALL file.

93 files changed:
changelog
client/adh-main.c
client/adh-opts.c
client/adh-query.c
client/adnshost.h
client/adnstest.c
regress/.cvsignore
regress/Makefile.in
regress/adnshost-xinitflags.text [new file with mode: 0644]
regress/case-1stservbroken.sys
regress/case-1stservtotcp.sys
regress/case-2ndservok.sys
regress/case-2ndservtcp.sys
regress/case-abbrev.sys
regress/case-abbrevto.sys
regress/case-adh-cancel.err [new file with mode: 0644]
regress/case-adh-cancel.out [new file with mode: 0644]
regress/case-adh-cancel.sys [new file with mode: 0644]
regress/case-adh-cancel2.err [new file with mode: 0644]
regress/case-adh-cancel2.out [new file with mode: 0644]
regress/case-adh-cancel2.sys [new file with mode: 0644]
regress/case-adh-norm.err [new file with mode: 0644]
regress/case-adh-norm.out [new file with mode: 0644]
regress/case-adh-norm.sys [new file with mode: 0644]
regress/case-adh-pipe.err [new file with mode: 0644]
regress/case-adh-pipe.out [new file with mode: 0644]
regress/case-adh-pipe.sys [new file with mode: 0644]
regress/case-brokenmail.sys
regress/case-child.sys
regress/case-cnametocname.sys
regress/case-comprinf.sys
regress/case-datapluscname.sys
regress/case-datapluscnamewait.sys
regress/case-flags10.sys
regress/case-flags9.sys
regress/case-formerr.sys
regress/case-lockup.sys
regress/case-longdom0.sys
regress/case-longdom1.sys
regress/case-longdomsrch0.sys
regress/case-longdomsrch1.sys
regress/case-longdomsrch1b.sys
regress/case-longdomsrch2.sys
regress/case-longlab0.sys
regress/case-longlab1.sys
regress/case-mailboxes.sys
regress/case-manya.sys
regress/case-manyptrwrong.sys
regress/case-manyptrwrongrem.sys
regress/case-manyptrwrongrst.sys
regress/case-manyptrwrongrty.sys
regress/case-ndots-as.sys
regress/case-ndots.sys
regress/case-ndotsbad.sys
regress/case-noinfto.sys
regress/case-norecurse.sys
regress/case-norecurse2.sys
regress/case-norecurse3.sys
regress/case-norm.sys
regress/case-owner.sys
regress/case-poll.sys
regress/case-polltimeout.sys
regress/case-ptrbaddom.sys
regress/case-quote.sys
regress/case-rootquery.sys
regress/case-rootqueryall-as.sys
regress/case-rootqueryall.sys
regress/case-search-as.sys
regress/case-search.sys
regress/case-searchabs.sys
regress/case-sillyrp.sys
regress/case-tcpallfail.sys
regress/case-tcpblock.sys
regress/case-tcpblockbrk.sys
regress/case-tcpblockwr.sys
regress/case-tcpbreakin.sys
regress/case-tcpmultipart.sys
regress/case-tcpptr.sys
regress/case-timeout.sys
regress/case-trunc.sys
regress/case-unknownq.sys
regress/harness.h.m4
regress/hcommon.c.m4
regress/hmacros.i4
regress/hplayback.c.m4
regress/hrecord.c.m4
regress/hredirect.h.m4 [new file with mode: 0644]
regress/hsyscalls.h.m4 [new file with mode: 0644]
regress/hsyscalls.i4
regress/m1test
regress/r1test
settings.make.in
src/internal.h

index 78e1c0f34b0f398630d96e378cf64bf4fb309fe7..60b0c43cdfd3a15389164c1d4c00feb93dafe032 100644 (file)
--- a/changelog
+++ b/changelog
@@ -3,6 +3,11 @@ adns (0.10) unstable; urgency=low
   Bugfixes:
   * Actually compile shared libraries by default !
 
+  General Improvements:
+  * adnshost has --config option for overriding configuration.
+  * Regression tests now include `adnshost' invocations.
+  * Test cancellation both before and after query completion.
+
   Portability fixes:
   * Fix <sys/fcntl.h> in client/adnsresfilter.c to <fcntl.h>.
   * #include <sys/types.h> and <unistd.h> for fcntl in */*.c.
@@ -12,6 +17,7 @@ adns (0.10) unstable; urgency=low
   * adnstest: setvbuf(stdout,...) before we do first output.
   * Cast a sizeof(...) in src/event.c to unsigned long before printing.
   * #include <sys/select.h> if it exists.
+  * Regression tests work better if some syscalls are already macros.
 
   Portability cleanups:
   * Add list of tested platforms in INSTALL file.
index 094295efdb4d4595ace09483a421e55f45db1eff..88d876a7b1c214c0446301b78ff5856686ed3fed 100644 (file)
 
 #include "adnshost.h"
 
+int rcode;
+const char *config_text;
+
+static int used, avail;
+static char *buf;
+
+void quitnow(int rc) {
+  if (ads) adns_finish(ads);
+  free(buf);
+  free(ov_id);
+  exit(rc);
+}
+
 void sysfail(const char *what, int errnoval) {
   fprintf(stderr,"adnshost failed: %s: %s\n",what,strerror(errnoval));
-  exit(10);
+  quitnow(10);
 }
 
 void usageerr(const char *fmt, ...) {
@@ -40,7 +53,7 @@ void usageerr(const char *fmt, ...) {
   vfprintf(stderr,fmt,al);
   va_end(al);
   putc('\n',stderr);
-  exit(11);
+  quitnow(11);
 }
 
 void outerr(void) {
@@ -62,6 +75,10 @@ char *xstrsave(const char *str) {
   return p;
 }
 
+void of_config(const struct optioninfo *oi, const char *arg, const char *arg2) {
+  config_text= arg;
+}
+
 void of_type(const struct optioninfo *oi, const char *arg, const char *arg2) {
   static const struct typename {
     adns_rrtype type;
@@ -100,8 +117,6 @@ void of_type(const struct optioninfo *oi, const char *arg, const char *arg2) {
   ov_type= tnp->type;
 }
 
-int rcode;
-
 static void process_optarg(const char *arg,
                           const char *const **argv_p,
                           const char *value) {
@@ -164,9 +179,6 @@ static void process_optarg(const char *arg,
 }
     
 static void read_stdin(void) {
-  static int used, avail;
-  static char *buf;
-
   int anydone, r;
   char *newline, *space;
 
@@ -248,5 +260,5 @@ int main(int argc, const char *const *argv) {
   }
 x_quit:
   if (fclose(stdout)) outerr();
-  exit(rcode);
+  quitnow(rcode);
 }
index 772e474f3fe7e1054244641cece4f4fd0b7a648d..4cc201abc06b179a69b63c8052072b7638ed58c7 100644 (file)
@@ -62,6 +62,8 @@ static const struct optioninfo global_options[]= {
     "Vd", "debug",         &ov_verbose, adns_if_debug },
                         
   { ot_desconly, "other global options:" },
+  { ot_funcarg,          "Configuration to use instead of /etc/resolv.conf",
+    0, "config",           0,0, of_config, "<config-text>" },
   { ot_func,             "Print usage information",
     0, "help",             0,0, of_help },
 
@@ -270,7 +272,7 @@ static void printusage(void) {
 void of_help(const struct optioninfo *oi, const char *arg, const char *arg2) {
   printusage();
   if (fclose(stdout)) sysfail("finish writing output",errno);
-  exit(0);
+  quitnow(0);
 }
 
 typedef int comparer_type(const char **optp, const struct optioninfo *entry);
index 856b6b2edd81b645b62eb1ae2d21840ee3dc34ef..edacb17072f2910e8a2dcc42ab601a0070d644e0 100644 (file)
@@ -34,16 +34,21 @@ struct outstanding_list outstanding;
 static unsigned long idcounter;
 
 void ensure_adns_init(void) {
+  adns_initflags initflags;
   int r;
   
   if (ads) return;
 
   if (signal(SIGPIPE,SIG_IGN) == SIG_ERR) sysfail("ignore SIGPIPE",errno);
-  r= adns_init(&ads,
-              adns_if_noautosys|adns_if_nosigpipe |
-              (ov_env ? 0 : adns_if_noenv) |
-              ov_verbose,
-              0);
+
+  initflags= adns_if_noautosys|adns_if_nosigpipe|ov_verbose;
+  if (!ov_env) initflags |= adns_if_noenv;
+
+  if (config_text) {
+    r= adns_init_strcfg(&ads, initflags, stderr, config_text);
+  } else {
+    r= adns_init(&ads, initflags, 0);
+  }
   if (r) sysfail("adns_init",r);
 
   if (ov_format == fmt_default)
@@ -143,6 +148,7 @@ void query_do(const char *domain) {
 static void dequeue_query(struct query_node *qun) {
   LIST_UNLINK(outstanding,qun);
   free(qun->id);
+  free(qun->owner);
   free(qun);
 }
 
index 7323fbf6fc543f9b62bb99d03d0275c38d0cb4ba..1fff4ef8286c0b9ad78e7be9ad46f516d5bdc567 100644 (file)
 #include "adns.h"
 #include "dlist.h"
 
+#ifdef ADNS_REGRESS_TEST
+# include "hredirect.h"
+#endif
+
 /* declarations related to option processing */
 
 struct optioninfo;
@@ -79,7 +83,8 @@ extern int ov_tcp, ov_cname, ov_format;
 extern char *ov_id;
 extern struct perqueryflags_remember ov_pqfr;
 
-extern optfunc of_help, of_type, of_ptr, of_reverse, of_asynch_id, of_cancel_id;
+extern optfunc of_config, of_help, of_type, of_ptr, of_reverse;
+extern optfunc of_asynch_id, of_cancel_id;
 
 const struct optioninfo *opt_findl(const char *opt);
 const struct optioninfo *opt_finds(const char **optp);
@@ -110,6 +115,9 @@ void outerr(void) NONRETURNING;
 void *xmalloc(size_t sz);
 char *xstrsave(const char *str);
 
+void quitnow(int rc) NONRETURNING;
+
 extern int rcode;
+extern const char *config_text; /* 0 => use defaults */
 
 #endif
index 3aa96c914814feae6d90ec526080895868f2ecb2..3a5b4f1efd40da4f26803e2f51c5f710dcfdb057 100644 (file)
@@ -36,8 +36,8 @@
 #include "config.h"
 #include "adns.h"
 
-#ifndef OUTPUTSTREAM
-# define OUTPUTSTREAM stdout
+#ifdef ADNS_REGRESS_TEST
+# include "hredirect.h"
 #endif
 
 struct myctx {
index 154e5a94c58f2a3aaf81ffa78bc12e2403596e4c..d2b132d00d514922d8b9c4c678e03b149dc8b9b6 100644 (file)
@@ -1,8 +1,12 @@
 Makefile
 harness.h
+hsyscalls.h
+hredirect.h
 hcommon.c
-hrecord
+*_record
+*_playback
 hrecord.c
-hplayback
 hplayback.c
 output-*.*
+pipe.out
+pipe.err
index 45218eda2ee9e1e97447a59a06da1e23b278b3bd..42fdb5cc029b5a1336645b81f256d0c8ad9364e5 100644 (file)
 srcdir=                @srcdir@
 VPATH=         @srcdir@
 
-TARGETS=       hplayback hrecord
-AUTOCSRCS=     harness.h hrecord.c hplayback.c hcommon.c
+CLIENTS=       adnstest adnshost
+AUTOCHDRS=     harness.h hsyscalls.h hredirect.h
+AUTOCSRCS=     hrecord.c hplayback.c hcommon.c
 include                $(srcdir)/../settings.make
 include                $(srcdir)/../src/adns.make
 
 DIRCFLAGS=     -I$(srcdir)/../src
 
-HCPPFLAGS:= $(foreach F,                       \
-       gettimeofday select poll                \
-       socket fcntl connect close              \
-       sendto recvfrom read write writev       \
-       malloc realloc free exit                \
-, -D$F=H$F)
+HCPPFLAGS=     -DADNS_REGRESS_TEST -I.
 
-HARNLOBJS=     $(addsuffix _d.o, $(basename $(LIBOBJS)))
-ALLOBJS=       $(HARNLOBJS) dtest.o hrecord.o hplayback.o hcommon.o
+REDIRLIBOBJS=  $(addsuffix _d.o, $(basename $(LIBOBJS)))
+HARNLOBJS=     hcommon.o $(REDIRLIBOBJS)
+TARGETS=       $(addsuffix _record, $(CLIENTS)) $(addsuffix _playback, $(CLIENTS))
+ADH_OBJS=      adh-main_c.o adh-opts_c.o adh-query_c.o
+ALL_OBJS=      $(HARNLOBJS) dtest.o hrecord.o hplayback.o
 
-.PRECIOUS:     $(AUTOCSRCS)
+.PRECIOUS:     $(AUTOCSRCS) $(AUTOCHDRS)
+
+all install uninstall: $(TARGETS)
 
 check:         $(TARGETS)
                ./checkall
 
-all install uninstall:
+LINK_CMD=      $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
+
+%_record:      %_c.o hrecord.o $(HARNLOBJS)
+               $(LINK_CMD)
+
+%_playback:    %_c.o hplayback.o $(HARNLOBJS)
+               $(LINK_CMD)
 
-hrecord:       adnstest_c.o hrecord.o hcommon.o $(HARNLOBJS)
-hplayback:     adnstest_c.o hplayback.o hcommon.o $(HARNLOBJS)
+adnshost_%:    $(ADH_OBJS) h%.o $(HARNLOBJS)
+               $(LINK_CMD)
 
-%_d.o:         $(srcdir)/../src/%.c
+%_d.o:         $(srcdir)/../src/%.c hredirect.h
                $(CC) $(HCPPFLAGS) -c -g -o $@ $<
 
-%_c.o:         $(srcdir)/../client/%.c
+%_c.o:         $(srcdir)/../client/%.c hredirect.h
                $(CC) $(HCPPFLAGS) -I $(srcdir)/../src -c -g -o $@ $<
 
-$(ALLOBJS):    $(srcdir)/../src/adns.h $(srcdir)/../src/internal.h harness.h
+$(ALL_OBJS):   $(srcdir)/../src/adns.h $(srcdir)/../src/internal.h
+$(ALL_OBJS):   harness.h hsyscalls.h
+$(ADH_OBJS):   $(srcdir)/../client/adnshost.h
 
 %::    %.m4 hmacros.i4 hsyscalls.i4
        $(M4) -P $< >$@-a.new
diff --git a/regress/adnshost-xinitflags.text b/regress/adnshost-xinitflags.text
new file mode 100644 (file)
index 0000000..3576c98
--- /dev/null
@@ -0,0 +1 @@
+--config 
index 2b1e9edf68f9971c033e38ac1c0fbe235c5511e2..3cb74e484a7c04d7984b64d93926a63dc25b1da0 100644 (file)
@@ -1,4 +1,4 @@
-1stservbroken
+adnstest 1stservbroken
 :12 trunc.test.iwj.relativity.greenend.org.uk
  start 940102940.701451
  socket type=SOCK_DGRAM
index 84a851c7504d4b39c3be225c2917bc13d7903a46..77f5bd318c0383c2d2b6e3c6ba8ff4ed52f0819c 100644 (file)
@@ -1,4 +1,4 @@
-1stservto
+adnstest 1stservto
 :12 trunc.test.iwj.relativity.greenend.org.uk
  start 940100259.965940
  socket type=SOCK_DGRAM
index 8ca8f8345a6566c07db374b459941d9a1e839206..fdb8e27f1b18b7944ff740ac98ecfd7321021cff 100644 (file)
@@ -1,4 +1,4 @@
-2ndserver
+adnstest 2ndserver
 :1 davenant.relativity.greenend.org.uk
  start 940100095.012145
  socket type=SOCK_DGRAM
index 0e6da2ed133298d3f5f36d92848a471bf7f22f62..b79bfd41a6250692a0c475637be8dd52bbb3536d 100644 (file)
@@ -1,4 +1,4 @@
-2ndserver
+adnstest 2ndserver
 :12 trunc.test.iwj.relativity.greenend.org.uk
  start 940100083.268555
  socket type=SOCK_DGRAM
index f98d716fe2c860028ca5c98a5710fa860cd15f1e..0fd7a73ea9d100151550022bbd92362dbaf5884c 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 ,a/greenend.org.uk
  start 929580078.542974
  socket type=SOCK_DGRAM
index ae1826c420465cd2727a32e0fc89aedc4ef4a930..f61cd0a66f11ca99840af2c808c03b76fec1f0d6 100644 (file)
@@ -1,4 +1,4 @@
-noserver
+adnstest noserver
 ,a/greenend.org.uk
  start 929580082.699581
  socket type=SOCK_DGRAM
diff --git a/regress/case-adh-cancel.err b/regress/case-adh-cancel.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-adh-cancel.out b/regress/case-adh-cancel.out
new file mode 100644 (file)
index 0000000..043c851
--- /dev/null
@@ -0,0 +1,2 @@
+davenant.relativity.greenend.org.uk A INET 172.18.45.6
+rc=0
diff --git a/regress/case-adh-cancel.sys b/regress/case-adh-cancel.sys
new file mode 100644 (file)
index 0000000..0c542a9
--- /dev/null
@@ -0,0 +1,73 @@
+./adnshost default -f
+
+ start 969124425.922896
+ socket type=SOCK_DGRAM
+ socket=6
+ +0.000162
+ fcntl fd=6 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000058
+ fcntl fd=6 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000035
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=null
+ select=1 rfds=[0] wfds=[] efds=[]
+ +0.000135
+ read fd=0 buflen=40
+ read=OK
+     2d2d6173 796e6368 2d696420 34320a63 68696172 6b2e6772 65656e65 6e642e6f
+     72672e75 6b0a2d2d.
+ +0.000254
+ sendto fd=6 addr=172.18.45.6:53
+     311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001.
+ sendto=40
+ +0.000825
+ read fd=0 buflen=38
+ read=OK
+     6173796e 63682d69 64203433 0a646176 656e616e 742e7265 6c617469 76697479
+     2e677265 656e.
+ +0.000184
+ read fd=0 buflen=15
+ read=OK
+     656e642e 6f72672e 756b0a2d 2d6361.
+ +0.000106
+ sendto fd=6 addr=172.18.45.6:53
+     31200100 00010000 00000000 08646176 656e616e 740a7265 6c617469 76697479
+     08677265 656e656e 64036f72 6702756b 00000100 01.
+ sendto=53
+ +0.000624
+ read fd=0 buflen=36
+ read=OK
+     6e63656c 2d696420 34320a.
+ +0.000145
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=1.999231
+ select=2 rfds=[0,6] wfds=[] efds=[]
+ +0.000157
+ recvfrom fd=6 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+     64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+     7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+     0004ac12 2d06c070 00010001 00015180 0004ac12 2d01.
+ +0.000551
+ recvfrom fd=6 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31208580 00010001 00020002 08646176 656e616e 740a7265 6c617469 76697479
+     08677265 656e656e 64036f72 6702756b 00000100 01c00c00 01000100 01518000
+     04ac122d 060a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b
+     00000200 01000151 80000603 6e7330c0 45c04500 02000100 01518000 06036e73
+     31c045c0 6b000100 01000151 800004ac 122d06c0 7d000100 01000151 800004ac
+     122d01.
+ +0.000579
+ recvfrom fd=6 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000151
+ read fd=0 buflen=40
+ read=OK
+     .
+ +0.000043
+ close fd=6
+ close=OK
+ +0.000961
diff --git a/regress/case-adh-cancel2.err b/regress/case-adh-cancel2.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-adh-cancel2.out b/regress/case-adh-cancel2.out
new file mode 100644 (file)
index 0000000..ab3f8d1
--- /dev/null
@@ -0,0 +1 @@
+rc=0
diff --git a/regress/case-adh-cancel2.sys b/regress/case-adh-cancel2.sys
new file mode 100644 (file)
index 0000000..f954087
--- /dev/null
@@ -0,0 +1,59 @@
+./adnshost default -f
+
+ start 969124594.885114
+ socket type=SOCK_DGRAM
+ socket=6
+ +0.000160
+ fcntl fd=6 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000057
+ fcntl fd=6 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000035
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=null
+ select=1 rfds=[0] wfds=[] efds=[]
+ +6.-286734
+ read fd=0 buflen=40
+ read=OK
+     2d2d6173 796e6368 2d696420 34320a.
+ +0.000727
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=null
+ select=1 rfds=[0] wfds=[] efds=[]
+ +0.000147
+ read fd=0 buflen=40
+ read=OK
+     63686961 726b2e67 7265656e 656e642e 6f72672e 756b0a.
+ +0.000129
+ sendto fd=6 addr=172.18.45.6:53
+     311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001.
+ sendto=40
+ +0.000802
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=1.999198
+ select=1 rfds=[0,6] wfds=[] efds=[]
+ +0.000135
+ recvfrom fd=6 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+     64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+     7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+     0004ac12 2d06c070 00010001 00015180 0004ac12 2d01.
+ +0.000553
+ recvfrom fd=6 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000195
+ read fd=0 buflen=40
+ read=OK
+     2d2d6361 6e63656c 2d696420 34320a.
+ +0.000688
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=null
+ select=1 rfds=[0] wfds=[] efds=[]
+ +2.-11588
+ read fd=0 buflen=40
+ read=OK
+     .
+ +0.000089
+ close fd=6
+ close=OK
+ +0.000149
diff --git a/regress/case-adh-norm.err b/regress/case-adh-norm.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-adh-norm.out b/regress/case-adh-norm.out
new file mode 100644 (file)
index 0000000..662ff60
--- /dev/null
@@ -0,0 +1,2 @@
+chiark.greenend.org.uk A INET 195.224.76.132
+rc=0
diff --git a/regress/case-adh-norm.sys b/regress/case-adh-norm.sys
new file mode 100644 (file)
index 0000000..672908f
--- /dev/null
@@ -0,0 +1,34 @@
+./adnshost default
+chiark.greenend.org.uk
+ start 969122933.609498
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000155
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000057
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000037
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001.
+ sendto=40
+ +0.000827
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999173
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000158
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+     64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+     7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+     0004ac12 2d06c070 00010001 00015180 0004ac12 2d01.
+ +0.000895
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000149
+ close fd=4
+ close=OK
+ +0.000290
diff --git a/regress/case-adh-pipe.err b/regress/case-adh-pipe.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-adh-pipe.out b/regress/case-adh-pipe.out
new file mode 100644 (file)
index 0000000..662ff60
--- /dev/null
@@ -0,0 +1,2 @@
+chiark.greenend.org.uk A INET 195.224.76.132
+rc=0
diff --git a/regress/case-adh-pipe.sys b/regress/case-adh-pipe.sys
new file mode 100644 (file)
index 0000000..320720a
--- /dev/null
@@ -0,0 +1,48 @@
+./adnshost default -f
+
+ start 969123801.904882
+ socket type=SOCK_DGRAM
+ socket=6
+ +0.000156
+ fcntl fd=6 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000057
+ fcntl fd=6 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000035
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=null
+ select=1 rfds=[0] wfds=[] efds=[]
+ +4.-792858
+ read fd=0 buflen=40
+ read=OK
+     63686961 726b2e67 7265656e 656e642e 6f72672e 756b0a.
+ +0.000235
+ sendto fd=6 addr=172.18.45.6:53
+     311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001.
+ sendto=40
+ +0.000847
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=1.999153
+ select=1 rfds=[6] wfds=[] efds=[]
+ +0.000140
+ recvfrom fd=6 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+     64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+     7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+     0004ac12 2d06c070 00010001 00015180 0004ac12 2d01.
+ +0.000548
+ recvfrom fd=6 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000184
+ select max=7 rfds=[0,6] wfds=[] efds=[] to=null
+ select=1 rfds=[0] wfds=[] efds=[]
+ +0.715699
+ read fd=0 buflen=40
+ read=OK
+     .
+ +0.000090
+ close fd=6
+ close=OK
+ +0.000134
index 9514d6b47203c1d4c512c772d74df9585a508881..dcf31dacdd0f3ad1e8bdef0c1c7eac5217ddab3e 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :15,65551 broken-mail.test.iwj.relativity.greenend.org.uk. 256/broken-mail.test.iwj.relativity.greenend.org.uk. 0x104/broken-mail.test.iwj.relativity.greenend.org.uk.
  start 934726868.117908
  socket type=SOCK_DGRAM
index 0cd1079c178e14976439999caff82855bf4e20aa..c0f82ac6f856382786a7fbda107dcbf3a39a5c59 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :65548 134.76.224.195.in-addr.arpa
  start 929574747.401802
  socket type=SOCK_DGRAM
index 97f2156c444bec02a31e2759d482d4b9a54c3957..4a9c52a0b0035a0c242d6fa4fd01fbf1acd0a313 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 intel.ugcs.caltech.edu.
  start 938369896.279735
  socket type=SOCK_DGRAM
index 20648184219ed308afb0b28db869bae779227327..e79e82678260ebf5e4976411c81961bd2c60073d 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :12 37.45.18.172.in-addr.arpa.
  start 951961094.184850
  socket type=SOCK_DGRAM
index e164b5307d449cb4d530ecc9514a7368755356ba..63d2b10ce2dd15a0c56830233620814945e1f48e 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 292/170.99.219.194.in-addr.arpa
  start 933809668.543946
  socket type=SOCK_DGRAM
index 77c5a132a840fcbbc465c6e7c1961dd13628e1e2..ff188ee8ae49bff021117faa4b979eed444a2fbf 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 292/170.99.219.194.in-addr.arpa
  start 933809632.795174
  socket type=SOCK_DGRAM
index c535eddb8e2f85831138c8cb73c91386be3badcc..fe0b3413a1e7975cba4847c594e8448c1191e901 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 ,aaaaaaaaaa/chiark.greenend.org.uk
  start 929580072.670441
  socket type=SOCK_DGRAM
index 94ac9699092f15d8a3ba4508b5849f4a3090e30e..914c556dd52510dee89320778cd4c990498f9b20 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 ,aaaaaaaaa/chiark.greenend.org.uk
  start 929580075.263215
  socket type=SOCK_DGRAM
index 7cf60347c743f992ce1bd28914f9df1c31ae3386..d455b19520e593c49d55e185b0f878249f000ad6 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 1/h.rndrobwlxxxxxxxxxxlllantysiliogogllanfairpwllgwyngyllgogerychw.relativity.greenend.org.uk.
  start 951956380.814815
  socket type=SOCK_DGRAM
index 8336d9244dacb06d0b96505e86e33d2811741dff..a14c5ac0ad9894ddc9d873c4c2783c2b84b30102 100644 (file)
@@ -1,4 +1,4 @@
-noserver
+adnstest noserver
 :1 chiark.greenend.org.uk
  start 912889153.349504
  socket type=SOCK_DGRAM
index e79da8cf046ac9d12a6997f3f91f6424ab9a2873..33a29efb355f995d41934324f266b00faee51985 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 1/0rndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.relativity.greenend.org.uk.
  start 951955651.857473
  socket type=SOCK_DGRAM
index f34cdde67d2319943f3d66ec182f4ece8123619f..a54e14d17ac55823029b467e776ba0c0ff7f8664 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 1/10rndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.relativity.greenend.org.uk.
  start 951955690.505811
  socket type=SOCK_DGRAM
index b0231247b18fa1cef8c74894d3df689bdb934a1c..298bec809f66171e9b9f2992d9e9a961f9e5e567 100644 (file)
@@ -1,4 +1,4 @@
-ndots100
+adnstest ndots100
 :1 1/10rndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.relativity.greenend.org.uk
  start 951956073.321566
  socket type=SOCK_DGRAM
index 8b6188844e754f1605f7dd47a9c3b52e8008e016..a61d920d12cc660fa9a1e1711331643f59220645 100644 (file)
@@ -1,4 +1,4 @@
-ndots100
+adnstest ndots100
 :1 1/0rndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.relativity.greenend.org.uk
  start 951956087.269350
  socket type=SOCK_DGRAM
index 6277dbd28d891b0ac46b3d7ee4951d722760b0be..e9e58dcfa60fc24952421b674ab9cb38ac17c8b5 100644 (file)
@@ -1,4 +1,4 @@
-ndots100
+adnstest ndots100
 :1 1/1xxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.relativity.greenend.org.uk
  start 951956136.566877
  socket type=SOCK_DGRAM
index 4df61ad685fcab021bcdace73248f2cd28d912ed..3c07b717eb5732c2347321362ae9100527abe0be 100644 (file)
@@ -1,4 +1,4 @@
-ndots100
+adnstest ndots100
 :1 1/xxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.llanfairpwllgwyngyllgogerychwyrndrobwlxxxxxxxxxxlllantysiliogog.relativity.greenend.org.uk
  start 951956143.624786
  socket type=SOCK_DGRAM
index 19ebb1487840ccc4525070582cee50a5ad9a7374..6bc3f84c181d1885a6437152f5e3eaabc08e86db 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 1/yrndrobwlxxxxxxxxxxlllantysiliogogllanfairpwllgwyngyllgogerychw.relativity.greenend.org.uk.
  start 951955250.786132
  socket type=SOCK_DGRAM
index 5698df7a1b5d9b7af156506fe97e2a6740852659..5b0e46adc66bcd802c94e03a89203b1210d57fc7 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 1/hyrndrobwlxxxxxxxxxxlllantysiliogogllanfairpwllgwyngyllgogerychw.relativity.greenend.org.uk.
  start 951955261.286712
  socket type=SOCK_DGRAM
index 2144c05ae94d2590f90b655c373d22cafcaf7c6c..9a0284f64f8e1ec33569e1c4c8896a12e7859a68 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :131089 silly-rp.test.iwj.relativity.greenend.org.uk
  start 923859567.899146
  socket type=SOCK_DGRAM
index 8b560fabbcc11ce574b20c6e6df6744f6d3c4a1e..4d1357b3eac1656864133f3cdf43b0c2d0a9ec14 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 manyaddrs.test.iwj.relativity.greenend.org.uk
  start 912888920.123769
  socket type=SOCK_DGRAM
index d5ef49b562828eb330260844ab22453d2a2e84b8..13467535f2d01474a3f37266f4599de78f25f43f 100644 (file)
@@ -1,4 +1,4 @@
-ncipher
+adnstest ncipher
 254.0.99.203.in-addr.arpa
  start 933269010.293417
  socket type=SOCK_DGRAM
index 3b90e59f06f6b4ad192bf358a638d037b7a925e8..24fe00ff5f4839407e1abb3cae555bca1222912d 100644 (file)
@@ -1,4 +1,4 @@
-manyptrwrong
+adnstest manyptrwrong
 292/254.0.99.203.in-addr.arpa
  start 933286859.476326
  socket type=SOCK_DGRAM
index cb0bdf0280799c53f6a53b80d3fd694b7e370daa..a577018810cbacdf783b67792eca40912f8ebd04 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 292/254.0.99.203.in-addr.arpa
  start 933289772.727140
  socket type=SOCK_DGRAM
index 826f4083d5dd9aee0408b47db59fa203e581d6ef..1afba85276da9afa207822e1e342ad6e55e7a5cd 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 292/254.0.99.203.in-addr.arpa
  start 933286845.072950
  socket type=SOCK_DGRAM
index b5f6e5ab5307cd838b1a333051dac69e098c96b4..f4e715362c6f3346f252b6cdd89664ff3eb7cb00 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 5/newsx.davenant 5/news.davenant 5/news.davenant.greenend.org.uk 5/trunc.test.iwj.relativity 5/trunx.test.iwj.relativity 5/test.iwj.relativity
  start 931992163.221752
  socket type=SOCK_DGRAM
index 8367d98952d7deacc18a4935909b8e61054da303..24717239dcf7983ffec69ba1feb9b57d695ab1cb 100644 (file)
@@ -1,4 +1,4 @@
-ndots -,s
+adnstest ndots -,s
 :1 5/newsx.davenant 5/news.davenant 5/news.davenant.greenend.org.uk 5/trunc.test.iwj.relativity 5/trunx.test.iwj.relativity 5/test.iwj.relativity
  start 924365863.351594
  socket type=SOCK_DGRAM
index 56d5877237268c044c6546bdc568c39757522c06..eaf457d3979e5ab1a643e22b21957a68aa570a13 100644 (file)
@@ -1,2 +1,2 @@
-ndotsbad
+adnstest ndotsbad
 :1 5/news.davenant.greenend.org.uk
index 422b38ac22491ca95d0c0c6e3751765abdf6d55a..ceeb2905d7e0e5c50bbeb892728668941e1fbfbb 100644 (file)
@@ -1,4 +1,4 @@
-noserver -,p
+adnstest noserver -,p
 :1 a.b.c.d
  start 940011574.766962
  socket type=SOCK_DGRAM
index bbeff65bfe69b9f33544eca7456922dd0e07d2d1..239b28229e44049763137ef436090e713d4a3b0b 100644 (file)
@@ -1,4 +1,4 @@
-default -0x16
+adnstest default -0x16
 4.204.50.158.in-addr.arpa
  start 939764098.821612
  socket type=SOCK_DGRAM
index 1397bbf883f22d9c4433823112c4b85b06ca119d..4029009bfb0cb32bbbc2978be1c4ddfb7fea10e3 100644 (file)
@@ -1,4 +1,4 @@
-default -0x16
+adnstest default -0x16
 4.204.50.158.in-addr.arpa
  start 939764277.018636
  socket type=SOCK_DGRAM
index 2daa4d5059cb56e09a0b70d0c87d154fcff0d629..56651c2bfc7bcf9f52a1583b5016376bf6cb580e 100644 (file)
@@ -1,4 +1,4 @@
-default -0x16
+adnstest default -0x16
 2.203.156.195.in-addr.arpa1
  start 939764258.086555
  socket type=SOCK_DGRAM
index 675a9bd7de5af01406bd1363c6106f4a97d8ba0d..ab58174776ea5db9b6526a0b0e0105109e016e82 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 chiark.greenend.org.uk
  start 912888966.802483
  socket type=SOCK_DGRAM
index 5e2c3356f3e4958766c4be38bc47bc74420f386b..aecce8007302952f08ae462d8a22471509ade169 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 4/chiark.greenend.org.uk
  start 933206012.504679
  socket type=SOCK_DGRAM
index ba055216388b6ac6d3c06b9034c069ce4b6fdf6d..a01e333ec968219e23213035f2add71922c02724 100644 (file)
@@ -1,4 +1,4 @@
-default -,p
+adnstest default -,p
 :1 chiark.greenend.org.uk
  start 931719947.391142
  socket type=SOCK_DGRAM
index 4e207f074105d8f10037ba280c5c6517952d72b6..3da57c08b1b00245235505714227dea52a1fc0a6 100644 (file)
@@ -1,4 +1,4 @@
-noserver -,p
+adnstest noserver -,p
 :1 chiark.greenend.org.uk
  start 931719968.733439
  socket type=SOCK_DGRAM
index 6b12372b9195f0b8f6f59ba50faa224db1ab8c16..11f376b1f8e2648d9bd6e857c198eeac12132db0 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :12,65548 37.45.18.172.in-addr.arpa.test.iwj.relativity.greenend.org.uk.
  start 951960654.608219
  socket type=SOCK_DGRAM
index 75e44d4da06b7c6f37c4977bfd319a70cfdd1bf8..0fec6358b9eacaeb87e65d619a671200b0d1e10f 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 hyphen.cname.test.iwj.relativity.greenend.org.uk dot.cname.test.iwj.relativity.greenend.org.uk plus.cname.test.iwj.relativity.greenend.org.uk slash.cname.test.iwj.relativity.greenend.org.uk underscore.cname.test.iwj.relativity.greenend.org.uk quote.cname.test.iwj.relativity.greenend.org.uk backslash.cname.test.iwj.relativity.greenend.org.uk null.cname.test.iwj.relativity.greenend.org.uk space.cname.test.iwj.relativity.greenend.org.uk hash.cname.test.iwj.relativity.greenend.org.uk del.cname.test.iwj.relativity.greenend.org.uk meta-null.cname.test.iwj.relativity.greenend.org.uk meta-del.cname.test.iwj.relativity.greenend.org.uk
  start 951958420.936685
  socket type=SOCK_DGRAM
index 4cd21b8c177b32872e2b43daca75c5c6071d04a7..1a91711480a8a3a15cf71728a4ed5bb364f0b81b 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :131078 . 1/.
  start 924364442.672925
  socket type=SOCK_DGRAM
index 532d875ca0bab1e2d2ee1d31c4a1e597a8392cff..745100d567eb29d015f66909df3155806b204857 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 . 1/.
  start 931992019.753022
  socket type=SOCK_DGRAM
index f38522d5407082340b89b0ca46ba729711e68225..d3427504c56d3b351e2f62adfbbf1cf966a32b1e 100644 (file)
@@ -1,4 +1,4 @@
-default -,s
+adnstest default -,s
 . 1/.
  start 924364450.165424
  socket type=SOCK_DGRAM
index c741d411e9f45b00871ab94348830cb1eccef509..5a7f11dee0f73afc2595c3db077142c888ebe0e1 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 0x5/news 0x5/chiark 1/news 1/chiark
  start 931992052.232208
  socket type=SOCK_DGRAM
index 1cbc3010e5c15d3fe17b3af74983133532f01f2e..29b719490fb711e612816db37c14c9d7e50080b5 100644 (file)
@@ -1,4 +1,4 @@
-default -,s
+adnstest default -,s
 :1 0x5/news 0x5/chiark 1/news 1/chiark
  start 924360470.478357
  socket type=SOCK_DGRAM
index 9899ffde1580d44c9ba386b70ac629f200f26a62..1167a7a4569dea744b4511a962627c94ef169692 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 1/news.davenant
  start 924363451.882765
  socket type=SOCK_DGRAM
index 2b28a49e1cd2cd6de34275e57b8913eb2c636d52..3fbdb542a1f32a3408fff3c7a515621c9a6cf2ce 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :17,131089 0x70/silly-rp-dm.test.iwj.relativity.greenend.org.uk 0x70/silly-rp-lp.test.iwj.relativity.greenend.org.uk silly-rp-lp.test.iwj.relativity.greenend.org.uk silly-rp-dm.test.iwj.relativity.greenend.org.uk
  start 929580348.131048
  socket type=SOCK_DGRAM
index 08718fc5180215bf3b48e2d150cd91f16a435cae..f17346be32b4e06750142322360afe8aad4114b6 100644 (file)
@@ -1,4 +1,4 @@
-anarres
+adnstest anarres
 2/test.iwj.relativity.greenend.org.uk.
  start 962142174.403028
  socket type=SOCK_DGRAM
index 5adf026f7bcca0ccd1f6e31e984f6f52e53f8f54..1257e1e9add06bd5183ccc34f3917871cdcb6c6d 100644 (file)
@@ -1,4 +1,4 @@
-anarres
+adnstest anarres
 2/test.iwj.relativity.greenend.org.uk.
  start 962142246.340485
  socket type=SOCK_DGRAM
index 68ce1d7f7f4392de8ff208f670140930756447d6..b4f517102b54d10d801f505603fb92afec5c239a 100644 (file)
@@ -1,4 +1,4 @@
-anarres -0x300
+adnstest anarres -0x300
 2/test.iwj.relativity.greenend.org.uk.
  start 962143388.709150
  socket type=SOCK_DGRAM
index 61c7bf526a76527bc737ed52916239f70d81222a..81864aa7eb3e101f5eb6ed3561a0627d219f4325 100644 (file)
@@ -1,4 +1,4 @@
-anarres -0x300
+adnstest anarres -0x300
 2/test.iwj.relativity.greenend.org.uk. 2/test.iwj.relativity.greenend.org.uk. 2/test.iwj.relativity.greenend.org.uk.
  start 962143438.172669
  socket type=SOCK_DGRAM
index 497923003e8ed69f0f3c9ed601825ee0539e88cd..9e8e75babe31ba02fffd437a51c1783528fb81b6 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :65548 2/6.45.18.172.in-addr.arpa
  start 957718868.938329
  socket type=SOCK_DGRAM
index bdc3f785e9de02b84c12b0bbb82ec93c02b295a9..d26ded29659c91f5278b09080e24c9d8fa2c1c6c 100644 (file)
@@ -1,4 +1,4 @@
-tunnel
+adnstest tunnel
 :12 2/132.76.224.195.in-addr.arpa 2/manymorerrs.test.culture.dotat.at. 2/132.76.224.195.in-addr.arpa
  start 938365454.994875
  socket type=SOCK_DGRAM
index bdddeea79d66ca88980134a3f6cb641e56ae8cdf..387dc87a2d5e22860f06c26d637b3f0e6a8ede0b 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :65548 2/6.45.18.172.in-addr.arpa
  start 957718868.938329
  socket type=SOCK_DGRAM
index 003d1ca6530eb635f42b7baa9060385230bdfddd..f810c3b55496b7c0e01d50191cb80d0561bfd761 100644 (file)
@@ -1,4 +1,4 @@
-noserver
+adnstest noserver
 :1 chiark.greenend.org.uk
  start 912889153.349504
  socket type=SOCK_DGRAM
index 4288e5dc9745e720b7e8f307da3a6fccedc58897..3698827b7138cc28c142f4797471ed48012f7126 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :1 trunc.test.iwj.relativity.greenend.org.uk
  start 912888921.274801
  socket type=SOCK_DGRAM
index ba279bb979063aec7b4181624420bfffd8962a5a..736210d0b4c3bbdceacf2e37f623759694a3d542 100644 (file)
@@ -1,4 +1,4 @@
-default
+adnstest default
 :32767 davenant.relativity.greenend.org.uk.
  start 933811310.565828
  socket type=SOCK_DGRAM
index 1f96131de216c06eacbf19eabad2f9c5787cef36..3988557ed905ba2c4e71b56130d26697cb655416 100644 (file)
@@ -3,7 +3,7 @@ m4_dnl (part of complex test harness, not of the library)
 m4_dnl - function and other declarations
 
 m4_dnl  This file is
-m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
 m4_dnl
 m4_dnl  It is part of adns, which is
 m4_dnl    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
@@ -28,30 +28,8 @@ m4_include(hmacros.i4)
 #ifndef HARNESS_H_INCLUDED
 #define HARNESS_H_INCLUDED
 
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <unistd.h>
-
 #include "internal.h"
-
-#ifdef HAVE_POLL
-#include <sys/poll.h>
-#endif
-
-/* We override several system calls with #define's */
-
-hm_create_proto_h
-m4_define(`hm_syscall', `int H$1(hm_args_massage($3,void));')
-m4_include(`hsyscalls.i4')
-
-int Hwritev(int fd, const struct iovec *vector, size_t count);
-int Hgettimeofday(struct timeval *tv, struct timezone *tz);
-
-void *Hmalloc(size_t sz);
-void Hfree(void *ptr);
-void *Hrealloc(void *op, size_t nsz);
-void Hexit(int rv);
+#include "hsyscalls.h"
 
 /* There is a Q function (Q for Question) for each such syscall;
  * it constructs a string representing the call, and calls Q_str
@@ -60,6 +38,7 @@ void Hexit(int rv);
 
 hm_create_proto_q
 m4_define(`hm_syscall', `void Q$1(hm_args_massage($3,void));')
+m4_define(`hm_specsyscall', `')
 m4_include(`hsyscalls.i4')
 
 void Q_vb(void);
index 2238cda571f8376ad5d875d10ee76f5f3e5c9e81..5807ddd453f1ea149a597ac44c87bc635893601d 100644 (file)
@@ -122,8 +122,9 @@ void Q$1(hm_args_massage($3,void)) {
 }
 ')
 
-m4_include(`hsyscalls.i4')
+m4_define(`hm_specsyscall', `')
 
+m4_include(`hsyscalls.i4')
 
 void Tvbaddr(const struct sockaddr *addr, int len) {
   const struct sockaddr_in *ai= (const struct sockaddr_in*)addr;
index 6f52787ffd166cc322cd79f50d198c8a508bdfc3..429c8257dcb3c1976399151ba6d9f4d462eff359 100644 (file)
@@ -32,10 +32,10 @@ m4_define(`hm_args_massage',
                                `'),
                `',
                `$2',
-               `
+               `m4_dnl
        m4_patsubst(m4_patsubst(m4_patsubst(m4_translit($1, `
        ',` '), `\(hm_comma *\)*$', `'), `^\( *hm_comma\)*', `'),
-               `\( *hm_comma *\)+',` hm_comma ')
+               `\( *hm_comma *\)+',` hm_comma ')m4_dnl
        ')')
 
 m4_define(`hm_create_nothing', `
index 22e975a6eeb65d5a216746d34ab5d0f971e5e51d..a3c2d8bdd0f9c0e077e5b801b5a31cc15cb5509f 100644 (file)
@@ -371,4 +371,6 @@ int H$1(hm_args_massage($3,void)) {
 }
 ')
 
+m4_define(`hm_specsyscall', `')
+
 m4_include(`hsyscalls.i4')
index 58d3636703d0cd7370aabec858758d7fc3f550f2..d59395f3401c074a59dddbd297a7f649c719260f 100644 (file)
@@ -154,4 +154,6 @@ int H$1(hm_args_massage($3,void)) {
 }
 ')
 
+m4_define(`hm_specsyscall', `')
+
 m4_include(`hsyscalls.i4')
diff --git a/regress/hredirect.h.m4 b/regress/hredirect.h.m4
new file mode 100644 (file)
index 0000000..8f7eeb9
--- /dev/null
@@ -0,0 +1,40 @@
+m4_dnl hredirect.h.m4
+m4_dnl (part of complex test harness, not of the library)
+m4_dnl - redefinitions of system calls
+
+m4_dnl  This file is
+m4_dnl    Copyright (C) 2000 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl  It is part of adns, which is
+m4_dnl    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+m4_dnl  
+m4_dnl  This program is free software; you can redistribute it and/or modify
+m4_dnl  it under the terms of the GNU General Public License as published by
+m4_dnl  the Free Software Foundation; either version 2, or (at your option)
+m4_dnl  any later version.
+m4_dnl  
+m4_dnl  This program is distributed in the hope that it will be useful,
+m4_dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+m4_dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+m4_dnl  GNU General Public License for more details.
+m4_dnl  
+m4_dnl  You should have received a copy of the GNU General Public License
+m4_dnl  along with this program; if not, write to the Free Software Foundation,
+m4_dnl  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+
+m4_include(hmacros.i4)
+
+#ifndef HREDIRECT_H_INCLUDED
+#define HREDIRECT_H_INCLUDED
+
+#include "hsyscalls.h"
+
+hm_create_nothing
+m4_define(`hm_syscall', `#undef $1
+#define $1 H$1')
+m4_define(`hm_specsyscall',`#undef $1
+#define $2 H$2')
+m4_include(`hsyscalls.i4')
+
+#endif
diff --git a/regress/hsyscalls.h.m4 b/regress/hsyscalls.h.m4
new file mode 100644 (file)
index 0000000..b74627e
--- /dev/null
@@ -0,0 +1,45 @@
+m4_dnl hsyscalls.h.m4
+m4_dnl (part of complex test harness, not of the library)
+m4_dnl - prototypes of redefinitions of system calls
+
+m4_dnl  This file is
+m4_dnl    Copyright (C) 2000 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl  It is part of adns, which is
+m4_dnl    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+m4_dnl  
+m4_dnl  This program is free software; you can redistribute it and/or modify
+m4_dnl  it under the terms of the GNU General Public License as published by
+m4_dnl  the Free Software Foundation; either version 2, or (at your option)
+m4_dnl  any later version.
+m4_dnl  
+m4_dnl  This program is distributed in the hope that it will be useful,
+m4_dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+m4_dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+m4_dnl  GNU General Public License for more details.
+m4_dnl  
+m4_dnl  You should have received a copy of the GNU General Public License
+m4_dnl  along with this program; if not, write to the Free Software Foundation,
+m4_dnl  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+
+m4_include(hmacros.i4)
+
+#ifndef HSYSCALLS_H_INCLUDED
+#define HSYSCALLS_H_INCLUDED
+
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <unistd.h>
+
+#ifdef HAVE_POLL
+#include <sys/poll.h>
+#endif
+
+hm_create_proto_h
+m4_define(`hm_syscall', `int H$1(hm_args_massage($3,void));')
+m4_define(`hm_specsyscall', `$1 H$2($3)$4;')
+m4_include(`hsyscalls.i4')
+
+#endif
index a31c7088607eabb140fe6b4ae66cc56b82c92205..b3ccd73a5ffdfaefd906747cb3d9c08de78a0c7a 100644 (file)
@@ -120,3 +120,11 @@ hm_syscall(
        hm_arg_fd(fd) hm_na
        hm_arg_bytes_in(void,buf,size_t,len) hm_na
 ')
+
+hm_specsyscall(int, writev, `int fd, const struct iovec *vector, size_t count')
+hm_specsyscall(int, gettimeofday, `struct timeval *tv, struct timezone *tz')
+
+hm_specsyscall(void*, malloc, `size_t sz')
+hm_specsyscall(void, free, `void *ptr')
+hm_specsyscall(void*, realloc, `void *op, size_t nsz')
+hm_specsyscall(void, exit, `int rv', NONRETURNING)
index 81b46345a4b00f11148941fc86ac9eb7a82a905c..c556f8c669061ea78365664e1c5c543464779ba4 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # usage: m1test <name> <initfile> [<initflags>] <queryargs>'
 # test recording script
 #
@@ -28,15 +28,15 @@ set -e
 if [ $# -lt 3 ]
 then
        echo >&2 \
-'usage: m1test <name> <initfile> [<initflags>] [=<hrecord-command-args>]
-       <queryargs>'
+'usage: m1test <name> <initfile> [-<initflags>]
+              [=<hrecord-command-args>] <queryargs>'
        exit 1
 fi
 
 case="case-$1"; shift
 initfile="$1"; shift
 
-hrecord="./hrecord"
+hrecord="./adnstest_record"
 
 case "$1" in
 -*)    initflags="$1"; shift
@@ -46,24 +46,56 @@ case "$1" in
 =*)    hrecord="`echo \"$1\" | sed -e 's/^=//'`"; shift
 esac
 
+if test ! -f "$hrecord" -a -f "${hrecord}_record"
+then
+       case "$hrecord" in
+       /*)     program="$hrecord"      ;;
+       *)      program="./$hrecord"    ;;
+       esac
+       hrecord="${program}_record"
+else
+       program="$(echo "$hrecord" | sed -e 's/ .*//; s/_record$//')"
+fi
+
 queryargs="$*"
 
 initstring="`cat init-$initfile.text`"
+xinitflagsf=$program-xinitflags.text
+if test -f $xinitflagsf
+then
+       useinitflags="$initflags $(cat $xinitflagsf)";
+else
+       useinitflags="$initflags /"
+fi
 
-echo $initfile $initflags >"$case.sys"
+echo $program $initfile $initflags >"$case.sys"
 echo "$queryargs" >>"$case.sys"
 
 EF_DISABLE_BANNER=1
 export EF_DISABLE_BANNER
 
-echo running hrecord $initflags "/... $queryargs"
+rm -f pipe.out pipe.err
+mknod pipe.out p
+mknod pipe.err p
+tee <pipe.out "$case.out" &
+tee_out=$!
+tee <pipe.err "$case.err" &
+tee_err=$!
+exec 4>pipe.out
+exec 5>pipe.err
+
+echo running hrecord $initflags "... $queryargs"
 set +e
-ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" </dev/null \
- $hrecord $initflags "/$initstring" $queryargs
+ADNS_TEST_OUT_FD=3 3>>"$case.sys" >&4 2>&5 \
+ $hrecord $useinitflags"$initstring" $queryargs
 rc=$?
 set -e
 
-echo "rc=$rc" >>$case.out
+echo "rc=$rc" >&4
+exec 4>&-
+exec 5>&-
+
+wait $tee_out
+wait $tee_err
 
-egrep . -- "$case.err" "$case.out"
 echo "exit status: $rc"
index 57df4bbdcf0a1442d8796635c63484f82c1c3a37..96d7195f46f83be5b4cca04be7bae40b8f84c767 100755 (executable)
@@ -32,10 +32,17 @@ case="case-$casename"
 ocase="output-$casename"
 
 exec <"$case.sys"
-read initfile initflags
+read program initfile initflags
 read queryargs
 
 initstring="`cat init-$initfile.text`"
+xinitflagsf=$program-xinitflags.text
+if test -f $xinitflagsf
+then
+       initflags="$initflags $(cat $xinitflagsf)";
+else
+       initflags="$initflags /"
+fi
 
 rm -f $ocase.*
 
@@ -44,7 +51,7 @@ export EF_DISABLE_BANNER
 
 set +e
 ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
- ./hplayback $initflags "/$initstring" $queryargs
+ ./${program}_playback $initflags"$initstring" $queryargs
 rc=$?
 set -e
 
index 63f2da76ca59e5820f559a09a2aaf1b0d6d3c59c..f276a6a103c7dbbb0d93aa506edd5fd8d31cf1dc 100644 (file)
@@ -64,7 +64,7 @@ clean mostlyclean:
 distclean:             clean
                rm -f $(TARGETS) *~ ./#*# core *.orig *.rej Makefile
 
-distprep:              $(AUTOCSRCS)
+distprep:              $(AUTOCSRCS) $(AUTOCHDRS)
 
 maintainer-clean:      distclean
-               -rm -f $(AUTOCSRCS)
+               -rm -f $(AUTOCSRCS) $(AUTOCHDRS)
index b82857cb13ba54ca7f0acbad3e9b14db7c96b355..ac8de47e2c468225af4e2d868270e4e16cd00819 100644 (file)
@@ -45,6 +45,10 @@ typedef unsigned char byte;
 #include "adns.h"
 #include "dlist.h"
 
+#ifdef ADNS_REGRESS_TEST
+# include "hredirect.h"
+#endif
+
 /* Configuration and constants */
 
 #define MAXSERVERS 5