[exim-cvs] Testsuite: avoid picking 0.0.0.0 as the HOSTIPV4;…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Testsuite: avoid picking 0.0.0.0 as the HOSTIPV4; permit 10.0/8 apart from 10.250.0/16
Gitweb: https://git.exim.org/exim.git/commitdiff/5c03403d88afcde2bb3f543296b0fca6f05c9f2c
Commit:     5c03403d88afcde2bb3f543296b0fca6f05c9f2c
Parent:     9af965827e65b7ad7419d3adeda5f79742472a82
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Fri Sep 20 10:23:46 2019 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Fri Sep 20 14:14:30 2019 +0100


    Testsuite: avoid picking 0.0.0.0 as the HOSTIPV4; permit 10.0/8 apart from 10.250.0/16


    Solaris leaves 0.0.0.0 lying around (for not-UP interfaces)
    The suite only needs testspace under 10.250.0/16 so we can permit the ret,
    making testing on many NATted 10.0/8 subnets possible.
---
 test/README  | 2 +-
 test/runtest | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/test/README b/test/README
index c255113..36cdd69 100644
--- a/test/README
+++ b/test/README
@@ -115,7 +115,7 @@ In order to run this test suite, the following requirements must be met:
     is also an IPv6 address, additional tests are run when the Exim binary
     contains IPv6 support. There are checks in the scripts for a running IPv4
     interface; when one is not found, some tests are skipped (with a warning
-    message).  The local net may not be in 10.0/8 as that is used by the suite.
+    message).  The local net may not be in 10.250.0/16 as that is used by the suite.


 (9) Exim must be built with TRUSTED_CONFIG_LIST support, so that the test
     configs can be placed into it.  A suitable file location is .../exim/test/trusted_configs
diff --git a/test/runtest b/test/runtest
index 2427aac..a93552b 100755
--- a/test/runtest
+++ b/test/runtest
@@ -3399,6 +3399,7 @@ else


# Find this host's IP addresses - there may be many, of course, but we keep
# one of each type (IPv4 and IPv6).
+#XXX it would be good to avoid non-UP interfaces

 open(IFCONFIG, '-|', (grep { -x "$_/ip" } split /:/, $ENV{PATH}) ? 'ip address' : 'ifconfig -a')
   or die "** Cannot run 'ip address' or 'ifconfig -a'\n";
@@ -3406,7 +3407,8 @@ while (not ($parm_ipv4 and $parm_ipv6) and defined($_ = <IFCONFIG>))
   {
   if (not $parm_ipv4 and /^\s*inet(?:\saddr)?:?\s?(\d+\.\d+\.\d+\.\d+)(?:\/\d+)?\s/i)
     {
-    next if $1 =~ /^(?:127|10)\./;
+    next if $1 =~ /^(?:127|10\.250)\./;
+    next if $1 eq '0.0.0.0';
     $parm_ipv4 = $1;
     }