Testsuite: for TFO testcases manipulate the system state
[exim.git] / test / scripts / 1990-TCP-Fast-Open / 1990
CommitLineData
a2673768
JH
1# TCP Fast Open
2#
3# Linux:
4# Both server and client-side TFO support must be enabled in the
5# kernel, 'sudo sh -c "echo 3 > /proc/sys/net/ipv4/tcp_fastopen"'.
6#
7# A packet capture on the loopback interface will show the TFO
8# option on the SYN, but the fast-output SMTP banner will not
9# be seen unless you also deliberately emulate a long path:
8255135b 10# 'sudo tc qdisc add dev lo root netem delay 50ms'
1ccd5f67
JH
11# You'll need kernel-modules-extra installed, or you get
12# an unhelpful error from RTNETLINK.
13# To tidy up: 'sudo tc qdisc delete dev lo root'
a2673768 14#
8255135b
JH
15sudo perl
16system ("tc qdisc add dev lo root netem delay 50ms");
17****
18#
a2673768
JH
19# First time runs will see a TFO request option only; subsequent
20# ones should see the TFO cookie and fast-output SMTP banner
21# (currently on a separate packet after the server SYN,ACK but before
22# the client ACK).
23#
ac0dcd3f
JH
24# The client log => lint.ex should have a "TFO" element.
25# Assuming this is the first run since boot, the a@test recipient will not.
26#
8255135b
JH
27sudo perl
28system ("ip tcp_metrics delete 127.0.0.1");
29****
30#
ac0dcd3f
JH
31# The server log <= line for b@test.ex should have a "TFO" element, but
32# this will only be obtained when the above delay is inserted into the
33# loopback net path.
a2673768 34#
a2673768
JH
35#
36#
37# FreeBSD: it looks like you have to compile a custom kernel, with
38# 'options TCP_RFC7413' in the config. Also set
39# 'net.inet.tcp.fastopen.enabled=1' in /etc/sysctl.conf
40# Untested.
41#
42exim -DSERVER=server -bd -oX PORT_D
43****
ac0dcd3f 44#
a2673768
JH
45exim a@test.ex
46Testing
47****
48sleep 3
ac0dcd3f 49#
a2673768
JH
50exim b@test.ex
51Testing
52****
53sleep 3
ac0dcd3f 54#
8255135b
JH
55#
56sudo perl
57system ("tc qdisc delete dev lo root");
58****
59#
a2673768
JH
60killdaemon
61no_msglog_check