Skip to content
Merged
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ cd packetdrill/gtests/net/packetdrill
make
```

If you are on a machine with a recent Linux kernel you can then su to root and
try running the tests included in the packetdrill distribution:
If you are on a machine with a recent Linux kernel you can su to root and
run all of the TCP stack tests included in the packetdrill distribution
in the tcp/ directory:

```
cd ..
./packetdrill/run_all.py -S -l
./packetdrill/run_all.py -S -v -L -l tcp/
```

# How To Submit a Patch for packetdrill
Expand Down
14 changes: 9 additions & 5 deletions gtests/net/packetdrill/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, args):
self.args = args
self.tools_path = os.path.abspath('./packetdrill')
self.default_args = '--send_omit_free'
self.max_runtime = 120
self.max_runtime = 180
self.num_pass = 0
self.num_fail = 0
self.num_timedout = 0
Expand Down Expand Up @@ -64,7 +64,7 @@ def StartTestIPv4(self, path):
'--local_ip=192.168.0.2 '
'--gateway_ip=192.168.0.1 '
'--netmask_ip=255.255.0.0 '
'--remote_ip=192.0.2.1 '
'--remote_ip=192.0.2.1/24 '
'-D TFO_COOKIE=de4f234f0f433a55 '
'-D CMSG_LEVEL_IP=SOL_IP '
'-D CMSG_TYPE_RECVERR=IP_RECVERR')
Expand All @@ -77,7 +77,7 @@ def StartTestIPv6(self, path):
('--ip_version=ipv6 --mtu=1520 '
'--local_ip=fd3d:fa7b:d17d::0 '
'--gateway_ip=fd3d:fa7b:d17d:8888::0 '
'--remote_ip=2001:DB8::1 '
'--remote_ip=2001:DB8::1/32 '
'-D TFO_COOKIE=6aa6ae70c288023b '
'-D CMSG_LEVEL_IP=SOL_IPV6 '
'-D CMSG_TYPE_RECVERR=IPV6_RECVERR')
Expand All @@ -91,7 +91,7 @@ def StartTestIPv4Mappedv6(self, path):
'--local_ip=192.168.0.2 '
'--gateway_ip=192.168.0.1 '
'--netmask_ip=255.255.0.0 '
'--remote_ip=192.0.2.1 '
'--remote_ip=192.0.2.1/24 '
'-D TFO_COOKIE=de4f234f0f433a55 '
'-D CMSG_LEVEL_IP=SOL_IPV6 '
'-D CMSG_TYPE_RECVERR=IPV6_RECVERR')
Expand Down Expand Up @@ -150,7 +150,11 @@ def PollTestSet(self, procs, time_start):

self.num_timedout = len(procs)
for proc, path, variant, outfile, errfile in procs:
proc.kill()
try:
proc.kill()
except:
if self.args['verbose']:
print('The test process has exited')
if self.args['verbose']:
print('KILL [%s (%s)]' % (path, variant))
if self.args['log_on_error']:
Expand Down
2 changes: 1 addition & 1 deletion gtests/net/packetdrill/tcp_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ struct tcp_option {
} __packed mp_fastclose;
/*******END MPTCP options*********/
} data;
} __packed tcp_option;
} __packed;

/* Allocate a new options list. */
extern struct tcp_options *tcp_options_new(void);
Expand Down
5 changes: 2 additions & 3 deletions gtests/net/tcp/mtu_probe/basic-v4.pkt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@

// enforce strict segment checking (and turn off gso) to measure probe length
--strict_segments
--remote_ip=192.168.1.1

// configure a small initial mtu
// increase cwnd to the minimum tcp_mtu_probe needs
`../common/defaults.sh
../common/set_sysctls.py \
/proc/sys/net/ipv4/tcp_mtu_probing=2 \
/proc/sys/net/ipv4/tcp_base_mss=512
ip route change 192.168.1.1 via 192.168.0.2 dev tun0 advmss 600 mtu lock 640 initcwnd 11
ip route add 192.0.2.1 via 192.168.0.2 dev tun0 advmss 600 mtu lock 640 initcwnd 11
ethtool -K tun0 gso off tso off
`

Expand All @@ -31,7 +30,7 @@
+.1 accept(3, ..., ...) = 4

// increase mtu
+0 `ip route change 192.168.1.1 via 192.168.0.2 dev tun0 advmss 1460 mtu lock 1500`
+0 `ip route change 192.0.2.1 via 192.168.0.2 dev tun0 advmss 1460 mtu lock 1500`

// new write will use known mtu, except for larger probe in first segment
// write must be much larger than probe, see size_needed
Expand Down
6 changes: 2 additions & 4 deletions gtests/net/tcp/mtu_probe/basic-v6.pkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
--strict_segments
--ip_version=ipv6
--local_ip=fd::1
--gateway_ip=fd::2
--remote_ip=fd::3

// configure a small initial mtu
// increase cwnd to the minimum tcp_mtu_probe needs
`../common/defaults.sh
../common/set_sysctls.py \
/proc/sys/net/ipv4/tcp_mtu_probing=2 \
/proc/sys/net/ipv4/tcp_base_mss=512
ip -6 route change fd::3 via fd::2 dev tun0 advmss 600 mtu lock 660 initcwnd 11
ip -6 route add 2001:DB8::1 via fd3d:fa7b:d17d:8888::0 dev tun0 advmss 600 mtu lock 660 initcwnd 11
ethtool -K tun0 gso off tso off
`

Expand All @@ -34,7 +32,7 @@
+.1 accept(3, ..., ...) = 4

// increase mtu
+0 `ip -6 route change fd::3 via fd::2 dev tun0 advmss 1480 mtu lock 1520`
+0 `ip -6 route change 2001:DB8::1 via fd3d:fa7b:d17d:8888::0 dev tun0 advmss 1480 mtu lock 1520`

// new write will use known mtu, except for larger probe in first segment
// write must be much larger than probe, see size_needed
Expand Down