From 22c3450e246798a06554257dc227eaf7f9b48741 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sat, 30 Nov 2019 16:00:26 +0000 Subject: [PATCH] Testsuite: split out ipv6 testcase needing a non-linklocal interface addr --- test/confs/1023 | 1 + test/log/1003 | 16 ++++++---------- test/log/1023 | 9 +++++++++ test/runtest | 7 ++++++- test/scripts/1000-Basic-ipv6/1003 | 10 ---------- test/scripts/1020-Linklocal-ipv6/1023 | 20 ++++++++++++++++++++ test/scripts/1020-Linklocal-ipv6/REQUIRES | 2 ++ 7 files changed, 44 insertions(+), 21 deletions(-) create mode 120000 test/confs/1023 create mode 100644 test/log/1023 create mode 100644 test/scripts/1020-Linklocal-ipv6/1023 create mode 100644 test/scripts/1020-Linklocal-ipv6/REQUIRES diff --git a/test/confs/1023 b/test/confs/1023 new file mode 120000 index 000000000..2478c955e --- /dev/null +++ b/test/confs/1023 @@ -0,0 +1 @@ +1003 \ No newline at end of file diff --git a/test/log/1003 b/test/log/1003 index 2ecb76664..4dc4d637c 100644 --- a/test/log/1003 +++ b/test/log/1003 @@ -1,25 +1,21 @@ 1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss 1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss 1999-03-02 09:44:33 10HmbA-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss -1999-03-02 09:44:33 10HmbB-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss 1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss 1999-03-02 09:44:33 Start queue run: pid=pppp -qf -1999-03-02 09:44:33 10HmaY-0005vi-00 => user4@h1.test.ex R=client T=send_to_server1 H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbC-0005vi-00" +1999-03-02 09:44:33 10HmaY-0005vi-00 => user4@h1.test.ex R=client T=send_to_server1 H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbB-0005vi-00" 1999-03-02 09:44:33 10HmaY-0005vi-00 Completed -1999-03-02 09:44:33 10HmaZ-0005vi-00 => user6@h2.test.ex R=client T=send_to_server2 H=::1 [::1] C="250 OK id=10HmbD-0005vi-00" +1999-03-02 09:44:33 10HmaZ-0005vi-00 => user6@h3.test.ex R=client T=send_to_server3 H=::1 [::1] C="250 OK id=10HmbC-0005vi-00" 1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed -1999-03-02 09:44:33 10HmbA-0005vi-00 => user6@h3.test.ex R=client T=send_to_server3 H=::1 [::1] C="250 OK id=10HmbE-0005vi-00" +1999-03-02 09:44:33 10HmbA-0005vi-00 => user6@h4.test.ex R=client T=send_to_server4 H=::1 [::1] C="250 OK id=10HmbD-0005vi-00" 1999-03-02 09:44:33 10HmbA-0005vi-00 Completed -1999-03-02 09:44:33 10HmbB-0005vi-00 => user6@h4.test.ex R=client T=send_to_server4 H=::1 [::1] C="250 OK id=10HmbF-0005vi-00" -1999-03-02 09:44:33 10HmbB-0005vi-00 Completed 1999-03-02 09:44:33 10HmaX-0005vi-00 == user6@h5.test.ex R=client T=send_to_server5 defer (-1): failed to expand "interface" option for send_to_server5 transport: condition name expected, but found "" 1999-03-02 09:44:33 End queue run: pid=pppp -qf ******** SERVER ******** 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port PORT_D (IPv6 and IPv4) -1999-03-02 09:44:33 10HmbC-0005vi-00 <= CALLER@myhost.test.ex H=the.local.host.name (myhost.test.ex) [ip4.ip4.ip4.ip4] P=esmtp S=sss id=E10HmaY-0005vi-00@myhost.test.ex -1999-03-02 09:44:33 10HmbD-0005vi-00 <= CALLER@myhost.test.ex H=the.local.host.name (myhost.test.ex) [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6] P=esmtp S=sss id=E10HmaZ-0005vi-00@myhost.test.ex +1999-03-02 09:44:33 10HmbB-0005vi-00 <= CALLER@myhost.test.ex H=the.local.host.name (myhost.test.ex) [ip4.ip4.ip4.ip4] P=esmtp S=sss id=E10HmaY-0005vi-00@myhost.test.ex 1999-03-02 09:44:33 no host name found for IP address ::1 -1999-03-02 09:44:33 10HmbE-0005vi-00 <= CALLER@myhost.test.ex H=(myhost.test.ex) [::1] P=esmtp S=sss id=E10HmbA-0005vi-00@myhost.test.ex +1999-03-02 09:44:33 10HmbC-0005vi-00 <= CALLER@myhost.test.ex H=(myhost.test.ex) [::1] P=esmtp S=sss id=E10HmaZ-0005vi-00@myhost.test.ex 1999-03-02 09:44:33 no host name found for IP address ::1 -1999-03-02 09:44:33 10HmbF-0005vi-00 <= CALLER@myhost.test.ex H=(myhost.test.ex) [::1] P=esmtp S=sss id=E10HmbB-0005vi-00@myhost.test.ex +1999-03-02 09:44:33 10HmbD-0005vi-00 <= CALLER@myhost.test.ex H=(myhost.test.ex) [::1] P=esmtp S=sss id=E10HmbA-0005vi-00@myhost.test.ex diff --git a/test/log/1023 b/test/log/1023 new file mode 100644 index 000000000..d946d9c74 --- /dev/null +++ b/test/log/1023 @@ -0,0 +1,9 @@ +1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss +1999-03-02 09:44:33 Start queue run: pid=pppp -qf +1999-03-02 09:44:33 10HmaX-0005vi-00 => user6@h2.test.ex R=client T=send_to_server2 H=::1 [::1] C="250 OK id=10HmaY-0005vi-00" +1999-03-02 09:44:33 10HmaX-0005vi-00 Completed +1999-03-02 09:44:33 End queue run: pid=pppp -qf + +******** SERVER ******** +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port PORT_D (IPv6 and IPv4) +1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex H=the.local.host.name (myhost.test.ex) [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6] P=esmtp S=sss id=E10HmaX-0005vi-00@myhost.test.ex diff --git a/test/runtest b/test/runtest index be35e157f..541d62ac3 100755 --- a/test/runtest +++ b/test/runtest @@ -3458,7 +3458,8 @@ while (not ($parm_ipv4 and $parm_ipv6) and defined($_ = )) $parm_ipv4 = $1; } - if (not $parm_ipv6 and /^\s*inet6(?:\saddr)?:?\s?([abcdef\d:]+)(?:%[^ \/]+)?(?:\/\d+)?/i) + if ( (not $parm_ipv6 or $parm_ipv6 =~ /%/) + and /^\s*inet6(?:\saddr)?:?\s?([abcdef\d:]+)(?:%[^ \/]+)?(?:\/\d+)?/i) { next if $1 eq '::' or $1 eq '::1' or $1 =~ /^ff00/i or $1 =~ /^fe80::1/i; $parm_ipv6 = $1; @@ -3827,6 +3828,10 @@ DIR: for (my $i = 0; $i < @test_dirs; $i++) } unlink("$parm_cwd/test-config"); } + elsif (/^ipv6-non-linklocal/) + { + if ($parm_ipv6 =~ /%/) { $wantthis = 0; last; } + } else { tests_exit(-1, "Unknown line in \"scripts/$testdir/REQUIRES\": \"$_\""); diff --git a/test/scripts/1000-Basic-ipv6/1003 b/test/scripts/1000-Basic-ipv6/1003 index 849d69a10..e52a1f57b 100644 --- a/test/scripts/1000-Basic-ipv6/1003 +++ b/test/scripts/1000-Basic-ipv6/1003 @@ -9,16 +9,6 @@ exim user4@h1.test.ex 1 interface: <; ::1 ; HOSTIPV4 **** -# -# This tries to send to ::1 from HOSTIPV6 - which is ok until HOSTIPV6 -# is a link-local addr (with a scope-id specifying the link). Then, -# it seems, ::1 is not on that link (for Linux, at least). The connect -# times out and the testcase fails. -exim user6@h2.test.ex - -2 -interface: <; HOSTIPV6 ; HOSTIPV4 -**** exim user6@h3.test.ex 3 diff --git a/test/scripts/1020-Linklocal-ipv6/1023 b/test/scripts/1020-Linklocal-ipv6/1023 new file mode 100644 index 000000000..2e5be6633 --- /dev/null +++ b/test/scripts/1020-Linklocal-ipv6/1023 @@ -0,0 +1,20 @@ +# interface selection (v4 vs v6) in outgoing SMTP, non-linklocal +need_ipv4 +need_ipv6 +# +exim -DSERVER=server -bd -oX PORT_D +**** +# +# This tries to send to ::1 from HOSTIPV6 - which is ok until HOSTIPV6 +# is a link-local addr (with a scope-id specifying the link). Then, +# it seems, ::1 is not on that link (for Linux & FreeBSD, at least). The connect +# times out and the testcase fails. +exim user6@h2.test.ex + +2 +interface: <; HOSTIPV6 ; HOSTIPV4 +**** +exim -qf +**** +killdaemon +no_msglog_check diff --git a/test/scripts/1020-Linklocal-ipv6/REQUIRES b/test/scripts/1020-Linklocal-ipv6/REQUIRES new file mode 100644 index 000000000..f8edd3e54 --- /dev/null +++ b/test/scripts/1020-Linklocal-ipv6/REQUIRES @@ -0,0 +1,2 @@ +support IPv6 +ipv6-non-linklocal -- 2.25.1