[exim-cvs] Testsuite: take care with the net-10 zonefile whe…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Testsuite: take care with the net-10 zonefile when operating in that area
Gitweb: https://git.exim.org/exim.git/commitdiff/218a6f15f24e2925c66c4855b4d255e1a11c7911
Commit:     218a6f15f24e2925c66c4855b4d255e1a11c7911
Parent:     c31e16a54f91476ce97ccd4d53a18c5bced1b320
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue Oct 1 21:36:33 2019 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Oct 1 21:36:33 2019 +0100


    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 45ee6e2..28976f0 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 ba73162..4cf1260 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)
     {