From ac9a0d9193d7d7ccd27aa8ebf31eb484182c3db4 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Wed, 18 Feb 2015 13:37:00 +0000 Subject: [PATCH] Testsuite: permit use of IPv6 loopback --- test/confs/5400 | 2 +- test/dnszones-src/db.test.ex | 2 ++ test/log/5400 | 8 ++++---- test/runtest | 6 +++++- test/scripts/4000-scanning/4001 | 2 ++ test/scripts/5400-cutthrough/5400 | 3 ++- test/stdout/4001 | 8 ++++---- test/stdout/5400 | 2 +- 8 files changed, 21 insertions(+), 12 deletions(-) diff --git a/test/confs/5400 b/test/confs/5400 index 5948ce8d2..79465df80 100644 --- a/test/confs/5400 +++ b/test/confs/5400 @@ -31,7 +31,7 @@ begin routers dns: driver = dnslookup - domains = localhost.test.ex : thishost.test.ex + domains = localhost.test.ex : localhost4.test.ex : thishost.test.ex self = send transport = smtp diff --git a/test/dnszones-src/db.test.ex b/test/dnszones-src/db.test.ex index 4ec367cc9..fec2a0d78 100644 --- a/test/dnszones-src/db.test.ex +++ b/test/dnszones-src/db.test.ex @@ -45,6 +45,8 @@ mx.π A V4NET.255.255.255 ; A non-standard name for localhost thishost A 127.0.0.1 +localhost4 A 127.0.0.1 + ; Something that gives both the IP and the loopback diff --git a/test/log/5400 b/test/log/5400 index c6f366272..a72dfeead 100644 --- a/test/log/5400 +++ b/test/log/5400 @@ -46,9 +46,9 @@ 1999-03-02 09:44:33 10HmbF-0005vi-00 => userx@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK" 1999-03-02 09:44:33 10HmbF-0005vi-00 => usery@special.com R=all T=smtp H=ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4] C="250 OK" 1999-03-02 09:44:33 10HmbF-0005vi-00 Completed -1999-03-02 09:44:33 rcpt for userx@localhost.test.ex +1999-03-02 09:44:33 rcpt for userx@localhost4.test.ex 1999-03-02 09:44:33 rcpt for usery@thishost.test.ex -1999-03-02 09:44:33 10HmbG-0005vi-00 >> usery@thishost.test.ex R=dns T=smtp H=localhost.test.ex [127.0.0.1] C="250 OK" -1999-03-02 09:44:33 10HmbG-0005vi-00 >> userx@localhost.test.ex R=dns T=smtp H=localhost.test.ex [127.0.0.1] C="250 OK" -1999-03-02 09:44:33 10HmbG-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userx@localhost.test.ex usery@thishost.test.ex +1999-03-02 09:44:33 10HmbG-0005vi-00 >> usery@thishost.test.ex R=dns T=smtp H=localhost4.test.ex [127.0.0.1] C="250 OK" +1999-03-02 09:44:33 10HmbG-0005vi-00 >> userx@localhost4.test.ex R=dns T=smtp H=localhost4.test.ex [127.0.0.1] C="250 OK" +1999-03-02 09:44:33 10HmbG-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userx@localhost4.test.ex usery@thishost.test.ex 1999-03-02 09:44:33 10HmbG-0005vi-00 Completed diff --git a/test/runtest b/test/runtest index c6d9c729e..2baf2cafd 100755 --- a/test/runtest +++ b/test/runtest @@ -1325,6 +1325,9 @@ $munges = 'optional_cert_hostnames' => { 'stderr' => '/in tls_verify_cert_hostnames\? no/' }, + 'loopback' => + { 'stdout' => 's/[[](127\.0\.0\.1|::1)]/[IP_LOOPBACK_ADDR]/' }, + }; @@ -1342,7 +1345,7 @@ $munges = # [4] TRUE if this is a log file whose deliveries must be sorted # [5] an optional custom munge command # -# Arguments: Optionally, name of a custom munge to run. +# Arguments: Optionally, name of a single custom munge to run. # Returns: 0 if the output compared equal # 1 if re-run needed (files may have been updated) @@ -3405,6 +3408,7 @@ foreach $test (@test_list) $stdout_skip = 0; $rmfiltertest = 0; $is_ipv6test = 0; + $TEST_STATE->{munge} = ""; # Remove the associative arrays used to hold checked mail files and msglogs diff --git a/test/scripts/4000-scanning/4001 b/test/scripts/4000-scanning/4001 index 25a676e04..1dcbd1fbc 100644 --- a/test/scripts/4000-scanning/4001 +++ b/test/scripts/4000-scanning/4001 @@ -1,5 +1,7 @@ # content scan interface: f-protd # +munge loopback +# server PORT_S -RCPT TO: +RCPT TO: RCPT TO: DATA diff --git a/test/stdout/4001 b/test/stdout/4001 index 40cf7a9d5..6d66c7d64 100644 --- a/test/stdout/4001 +++ b/test/stdout/4001 @@ -45,14 +45,14 @@ ******** SERVER ******** Listening on port 1224 ... -Connection request from [127.0.0.1] +Connection request from [IP_LOOPBACK_ADDR] >*eof End of script Listening on port 1224 ... -Connection request from [127.0.0.1] +Connection request from [IP_LOOPBACK_ADDR] @@ -64,12 +64,12 @@ Connection request from [127.0.0.1] >*eof End of script Listening on port 1224 ... -Connection request from [127.0.0.1] +Connection request from [IP_LOOPBACK_ADDR] 250 Sender OK -RCPT TO: +RCPT TO: 250 ok rcpt-1 RCPT TO: 250 ok rcpt-2 -- 2.25.1