From: Jeremy Harris Date: Thu, 21 Jan 2021 12:23:41 +0000 (+0000) Subject: Testsuite: shuffling X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/4718c75d346777872c87ff7d4fe0431487e618c4?ds=sidebyside Testsuite: shuffling --- diff --git a/test/confs/1090 b/test/confs/1090 new file mode 100644 index 000000000..4a7b25f3c --- /dev/null +++ b/test/confs/1090 @@ -0,0 +1,48 @@ +# Exim test configuration 1090 +# TCP Fast Open + +SERVER= + +.include DIR/aux-var/std_conf_prefix + +primary_hostname = myhost.test.ex + +# ----- Main settings ----- + +acl_smtp_rcpt = accept +log_selector = +received_recipients +millisec + +# ----- Routers ----- + +begin routers + +server: + driver = redirect + condition = ${if eq {SERVER}{server} {yes}{no}} + data = :blackhole: + +client: + driver = accept + condition = ${if eq {SERVER}{server}{no}{yes}} + transport = send_to_server + + +# ----- Transports ----- + +begin transports + +send_to_server: + driver = smtp + allow_localhost + hosts = 127.0.0.1 + port = PORT_D + hosts_try_fastopen = * + +# ----- Retry ----- + +begin retry + +* * F,5d,10s + + +# End diff --git a/test/confs/1990 b/test/confs/1990 deleted file mode 100644 index 4c2bdc29d..000000000 --- a/test/confs/1990 +++ /dev/null @@ -1,48 +0,0 @@ -# Exim test configuration 1990 -# TCP Fast Open - -SERVER= - -.include DIR/aux-var/std_conf_prefix - -primary_hostname = myhost.test.ex - -# ----- Main settings ----- - -acl_smtp_rcpt = accept -log_selector = +received_recipients +millisec - -# ----- Routers ----- - -begin routers - -server: - driver = redirect - condition = ${if eq {SERVER}{server} {yes}{no}} - data = :blackhole: - -client: - driver = accept - condition = ${if eq {SERVER}{server}{no}{yes}} - transport = send_to_server - - -# ----- Transports ----- - -begin transports - -send_to_server: - driver = smtp - allow_localhost - hosts = 127.0.0.1 - port = PORT_D - hosts_try_fastopen = * - -# ----- Retry ----- - -begin retry - -* * F,5d,10s - - -# End diff --git a/test/log/1090 b/test/log/1090 new file mode 100644 index 000000000..3d12e35e2 --- /dev/null +++ b/test/log/1090 @@ -0,0 +1,15 @@ +2017-07-30 18:51:05.712 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss for a@test.ex +2017-07-30 18:51:05.712 10HmaX-0005vi-00 => a@test.ex R=client T=send_to_server H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmaY-0005vi-00" +2017-07-30 18:51:05.712 10HmaX-0005vi-00 Completed +2017-07-30 18:51:05.712 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss for b@test.ex +2017-07-30 18:51:05.712 10HmaZ-0005vi-00 => b@test.ex R=client T=send_to_server H=127.0.0.1 [127.0.0.1] TFO C="250 OK id=10HmbA-0005vi-00" +2017-07-30 18:51:05.712 10HmaZ-0005vi-00 Completed + +******** SERVER ******** +2017-07-30 18:51:05.712 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port PORT_D +2017-07-30 18:51:05.712 10HmaY-0005vi-00 <= CALLER@myhost.test.ex H=localhost (myhost.test.ex) [127.0.0.1] P=esmtp S=sss id=E10HmaX-0005vi-00@myhost.test.ex for a@test.ex +2017-07-30 18:51:05.712 10HmaY-0005vi-00 => :blackhole: R=server +2017-07-30 18:51:05.712 10HmaY-0005vi-00 Completed +2017-07-30 18:51:05.712 10HmbA-0005vi-00 <= CALLER@myhost.test.ex H=localhost (myhost.test.ex) [127.0.0.1] TFO P=esmtp S=sss id=E10HmaZ-0005vi-00@myhost.test.ex for b@test.ex +2017-07-30 18:51:05.712 10HmbA-0005vi-00 => :blackhole: R=server +2017-07-30 18:51:05.712 10HmbA-0005vi-00 Completed diff --git a/test/log/1990 b/test/log/1990 deleted file mode 100644 index 3d12e35e2..000000000 --- a/test/log/1990 +++ /dev/null @@ -1,15 +0,0 @@ -2017-07-30 18:51:05.712 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss for a@test.ex -2017-07-30 18:51:05.712 10HmaX-0005vi-00 => a@test.ex R=client T=send_to_server H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmaY-0005vi-00" -2017-07-30 18:51:05.712 10HmaX-0005vi-00 Completed -2017-07-30 18:51:05.712 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss for b@test.ex -2017-07-30 18:51:05.712 10HmaZ-0005vi-00 => b@test.ex R=client T=send_to_server H=127.0.0.1 [127.0.0.1] TFO C="250 OK id=10HmbA-0005vi-00" -2017-07-30 18:51:05.712 10HmaZ-0005vi-00 Completed - -******** SERVER ******** -2017-07-30 18:51:05.712 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port PORT_D -2017-07-30 18:51:05.712 10HmaY-0005vi-00 <= CALLER@myhost.test.ex H=localhost (myhost.test.ex) [127.0.0.1] P=esmtp S=sss id=E10HmaX-0005vi-00@myhost.test.ex for a@test.ex -2017-07-30 18:51:05.712 10HmaY-0005vi-00 => :blackhole: R=server -2017-07-30 18:51:05.712 10HmaY-0005vi-00 Completed -2017-07-30 18:51:05.712 10HmbA-0005vi-00 <= CALLER@myhost.test.ex H=localhost (myhost.test.ex) [127.0.0.1] TFO P=esmtp S=sss id=E10HmaZ-0005vi-00@myhost.test.ex for b@test.ex -2017-07-30 18:51:05.712 10HmbA-0005vi-00 => :blackhole: R=server -2017-07-30 18:51:05.712 10HmbA-0005vi-00 Completed diff --git a/test/scripts/1090-TCP-Fast-Open/1090 b/test/scripts/1090-TCP-Fast-Open/1090 new file mode 100644 index 000000000..d2c7b75f9 --- /dev/null +++ b/test/scripts/1090-TCP-Fast-Open/1090 @@ -0,0 +1,97 @@ +# TCP Fast Open +# +# Linux: +# Both server and client-side TFO support must be enabled in the +# kernel, 'sudo sh -c "echo 3 > /proc/sys/net/ipv4/tcp_fastopen"'. +# +# A packet capture on the loopback interface will show the TFO +# option on the SYN, but the fast-output SMTP banner will not +# be seen unless you also deliberately emulate a long path: +# 'sudo tc qdisc add dev lo root netem delay 50ms' +# You'll need iproute-tc installed, for the tc command. +# You'll need kernel-modules-extra installed, or you get +# an unhelpful error from RTNETLINK. +# To tidy up: 'sudo tc qdisc delete dev lo root' +# +# MacOS: +# The kernel seems to have TFO enabled both ways as default. +# There is a net.inet.tcp.clear_tfocache parameter +## sysctl -w foo-val +# +# For network delays there is something called 'Network Link Conditioner' +# which might do the job. But how to manipulate it? +# +# +# FreeBSD: it looks like you have to compile a custom kernel, with +# 'options TCP_RFC7413' in the config. Also set +# 'net.inet.tcp.fastopen.server_enable=1' in /etc/sysctl.conf +# Seems to always claim TFO used by transport, if tried. +# +# FreeBSD: tried this setup, but we only get the banner captured 100ms after 3rd-ack: +# #kenv net.inet.ip.fw.default_to_accept=1 +# #kldload ipfw dummynet +# #ipfw add 00097 pipe 1 ip from 127.0.0.1 to 127.0.0.1 +# #ipfw pipe 1 config delay 50ms +# Also, the VM managed to lose the ipv4 & 6 addrs on its main interface +# after a while - so not usable in production +# +sudo perl +system ("tc qdisc add dev lo root netem delay 50ms"); +**** +# +# +# Disable the TFO blackhole detection, as we seem to be running foul of it. +# If bitten, we see the expected EINPROGRESS for sendto, yet no TFO cookie +# option on the SYN. +# +sudo perl +system ("[ -e /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_sec ] && echo 0 > /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_sec"); +**** +# +# First time runs will see a TFO request option only; subsequent +# ones should see the TFO cookie and fast-output SMTP banner +# (currently on a separate packet after the server SYN,ACK but before +# the client ACK). +# +# The client log => line should have a "TFO" element. +# The server log <= line for a@test.ex should not. +# +# First clear any previously-obtained cookie: +sudo perl +open(INFO, "-|", "/usr/bin/uname -s"); +$_ = ; +if (/^FreeBSD/) { +system("sysctl net.inet.tcp.fastopen.client_enable=0"); system("sysctl net.inet.tcp.fastopen.client_enable=1"); +} else { +system ("ip tcp_metrics delete 127.0.0.1"); +} + +**** +# +# +# +exim -DSERVER=server -bd -oX PORT_D +**** +# +exim a@test.ex +Testing +**** +sleep 3 +# +# The server log <= line for b@test.ex should have a "TFO" element, but +# this will only be obtained when the above delay is inserted into the +# loopback net path. +# +exim b@test.ex +Testing +**** +sleep 3 +# +# +sudo perl +system ("tc qdisc delete dev lo root"); +system ("[ -e /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_sec ] && echo 3600 > /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_sec"); +**** +# +killdaemon +no_msglog_check diff --git a/test/scripts/1090-TCP-Fast-Open/REQUIRES b/test/scripts/1090-TCP-Fast-Open/REQUIRES new file mode 100644 index 000000000..48cd58b67 --- /dev/null +++ b/test/scripts/1090-TCP-Fast-Open/REQUIRES @@ -0,0 +1 @@ +support TCP_Fast_Open diff --git a/test/scripts/1990-TCP-Fast-Open/1990 b/test/scripts/1990-TCP-Fast-Open/1990 deleted file mode 100644 index d2c7b75f9..000000000 --- a/test/scripts/1990-TCP-Fast-Open/1990 +++ /dev/null @@ -1,97 +0,0 @@ -# TCP Fast Open -# -# Linux: -# Both server and client-side TFO support must be enabled in the -# kernel, 'sudo sh -c "echo 3 > /proc/sys/net/ipv4/tcp_fastopen"'. -# -# A packet capture on the loopback interface will show the TFO -# option on the SYN, but the fast-output SMTP banner will not -# be seen unless you also deliberately emulate a long path: -# 'sudo tc qdisc add dev lo root netem delay 50ms' -# You'll need iproute-tc installed, for the tc command. -# You'll need kernel-modules-extra installed, or you get -# an unhelpful error from RTNETLINK. -# To tidy up: 'sudo tc qdisc delete dev lo root' -# -# MacOS: -# The kernel seems to have TFO enabled both ways as default. -# There is a net.inet.tcp.clear_tfocache parameter -## sysctl -w foo-val -# -# For network delays there is something called 'Network Link Conditioner' -# which might do the job. But how to manipulate it? -# -# -# FreeBSD: it looks like you have to compile a custom kernel, with -# 'options TCP_RFC7413' in the config. Also set -# 'net.inet.tcp.fastopen.server_enable=1' in /etc/sysctl.conf -# Seems to always claim TFO used by transport, if tried. -# -# FreeBSD: tried this setup, but we only get the banner captured 100ms after 3rd-ack: -# #kenv net.inet.ip.fw.default_to_accept=1 -# #kldload ipfw dummynet -# #ipfw add 00097 pipe 1 ip from 127.0.0.1 to 127.0.0.1 -# #ipfw pipe 1 config delay 50ms -# Also, the VM managed to lose the ipv4 & 6 addrs on its main interface -# after a while - so not usable in production -# -sudo perl -system ("tc qdisc add dev lo root netem delay 50ms"); -**** -# -# -# Disable the TFO blackhole detection, as we seem to be running foul of it. -# If bitten, we see the expected EINPROGRESS for sendto, yet no TFO cookie -# option on the SYN. -# -sudo perl -system ("[ -e /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_sec ] && echo 0 > /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_sec"); -**** -# -# First time runs will see a TFO request option only; subsequent -# ones should see the TFO cookie and fast-output SMTP banner -# (currently on a separate packet after the server SYN,ACK but before -# the client ACK). -# -# The client log => line should have a "TFO" element. -# The server log <= line for a@test.ex should not. -# -# First clear any previously-obtained cookie: -sudo perl -open(INFO, "-|", "/usr/bin/uname -s"); -$_ = ; -if (/^FreeBSD/) { -system("sysctl net.inet.tcp.fastopen.client_enable=0"); system("sysctl net.inet.tcp.fastopen.client_enable=1"); -} else { -system ("ip tcp_metrics delete 127.0.0.1"); -} - -**** -# -# -# -exim -DSERVER=server -bd -oX PORT_D -**** -# -exim a@test.ex -Testing -**** -sleep 3 -# -# The server log <= line for b@test.ex should have a "TFO" element, but -# this will only be obtained when the above delay is inserted into the -# loopback net path. -# -exim b@test.ex -Testing -**** -sleep 3 -# -# -sudo perl -system ("tc qdisc delete dev lo root"); -system ("[ -e /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_sec ] && echo 3600 > /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_sec"); -**** -# -killdaemon -no_msglog_check diff --git a/test/scripts/1990-TCP-Fast-Open/REQUIRES b/test/scripts/1990-TCP-Fast-Open/REQUIRES deleted file mode 100644 index 48cd58b67..000000000 --- a/test/scripts/1990-TCP-Fast-Open/REQUIRES +++ /dev/null @@ -1 +0,0 @@ -support TCP_Fast_Open