From 218a6f15f24e2925c66c4855b4d255e1a11c7911 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 1 Oct 2019 21:36:33 +0100 Subject: [PATCH] Testsuite: take care with the net-10 zonefile when operating in that area --- test/runtest | 27 +++++++++++++++++++-------- test/src/server.c | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/test/runtest b/test/runtest index 45ee6e208..28976f03f 100755 --- a/test/runtest +++ b/test/runtest @@ -3913,14 +3913,25 @@ if ($have_ipv4 || $have_ipv6) if ($have_ipv4 && $parm_ipv4 ne "127.0.0.1") { my(@components) = $parm_ipv4 =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)/; - open(OUT, ">$parm_cwd/dnszones/db.ip4.$components[0]") || - tests_exit(-1, - "Failed to open $parm_cwd/dnszones/db.ip4.$components[0]: $!"); - print OUT "; This is a dynamically constructed fake zone file.\n" . - "; The zone is $components[0].in-addr.arpa.\n\n" . - "$components[3].$components[2].$components[1] PTR $parm_hostname.\n\n" . - "; End\n"; - close(OUT); + + if ($components[0]=='10') + { + open(OUT, ">>$parm_cwd/dnszones/db.ip4.$components[0]") || + tests_exit(-1, "Failed to open $parm_cwd/dnszones/db.ip4.$components[0]: $!"); + print OUT "$components[3].$components[2].$components[1] PTR $parm_hostname.\n\n"; + close(OUT); + } + else + { + open(OUT, ">$parm_cwd/dnszones/db.ip4.$components[0]") || + tests_exit(-1, + "Failed to open $parm_cwd/dnszones/db.ip4.$components[0]: $!"); + print OUT "; This is a dynamically constructed fake zone file.\n" . + "; The zone is $components[0].in-addr.arpa.\n\n" . + "$components[3].$components[2].$components[1] PTR $parm_hostname.\n\n" . + "; End\n"; + close(OUT); + } } if ($have_ipv6 && $parm_ipv6 ne "::1") diff --git a/test/src/server.c b/test/src/server.c index ba731625b..4cf126068 100644 --- a/test/src/server.c +++ b/test/src/server.c @@ -278,7 +278,7 @@ if (initial_pause > 0) if (port == 0) /* Unix domain */ { - if (debug) printf("%d: Creating Unix domain socket\n", time(NULL)); + if (debug) printf("%l: Creating Unix domain socket\n", (long) time(NULL)); listen_socket[udn] = socket(PF_UNIX, SOCK_STREAM, 0); if (listen_socket[udn] < 0) { -- 2.30.2