xref: /freebsd/tests/sys/netpfil/pf/sctp.sh (revision 8ed5170c)
1#
2# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3#
4# Copyright © 2023 Orange Business Services
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright
12#    notice, this list of conditions and the following disclaimer in the
13#    documentation and/or other materials provided with the distribution.
14#
15# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26
27. $(atf_get_srcdir)/utils.subr
28
29sctp_init()
30{
31	pft_init
32	if ! kldstat -q -m sctp; then
33		atf_skip "This test requires SCTP"
34	fi
35}
36
37atf_test_case "basic_v4" "cleanup"
38basic_v4_head()
39{
40	atf_set descr 'Basic SCTP connection over IPv4 passthrough'
41	atf_set require.user root
42}
43
44basic_v4_body()
45{
46	sctp_init
47
48	j="sctp:basic_v4"
49	epair=$(vnet_mkepair)
50
51	vnet_mkjail ${j}a ${epair}a
52	vnet_mkjail ${j}b ${epair}b
53
54	jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up
55	jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up
56	# Sanity check
57	atf_check -s exit:0 -o ignore \
58	    jexec ${j}a ping -c 1 192.0.2.2
59
60	jexec ${j}a pfctl -e
61	pft_set_rules ${j}a \
62		"block" \
63		"pass in proto sctp to port 1234"
64
65	echo "foo" | jexec ${j}a nc --sctp -N -l 1234 &
66
67	# Wait for the server to start
68	sleep 1
69
70	out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1234)
71	if [ "$out" != "foo" ]; then
72		atf_fail "SCTP connection failed"
73	fi
74
75	# Now with scrub rules present, so normalization is done
76	pft_set_rules ${j}a \
77		"scrub on ${j}a" \
78		"block" \
79		"pass in proto sctp to port 1234"
80
81	echo "foo" | jexec ${j}a nc --sctp -N -l 1234 &
82	sleep 1
83
84	out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1234)
85	if [ "$out" != "foo" ]; then
86		atf_fail "SCTP connection failed"
87	fi
88
89	# Now fail with a blocked port
90	echo "foo" | jexec ${j}a nc --sctp -N -l 1235 &
91	sleep 1
92
93	out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1235)
94	if [ "$out" == "foo" ]; then
95		atf_fail "SCTP port block failed"
96	fi
97
98	# Now fail with a blocked port but passing source port
99	out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1235)
100	if [ "$out" == "foo" ]; then
101		atf_fail "SCTP port block failed"
102	fi
103}
104
105basic_v4_cleanup()
106{
107	pft_cleanup
108}
109
110atf_test_case "basic_v6" "cleanup"
111basic_v6_head()
112{
113	atf_set descr 'Basic SCTP connection over IPv6'
114	atf_set require.user root
115}
116
117basic_v6_body()
118{
119	sctp_init
120
121	j="sctp:basic_v6"
122	epair=$(vnet_mkepair)
123
124	vnet_mkjail ${j}a ${epair}a
125	vnet_mkjail ${j}b ${epair}b
126
127	jexec ${j}a ifconfig ${epair}a inet6 2001:db8::a/64 up no_dad
128	jexec ${j}b ifconfig ${epair}b inet6 2001:db8::b/64 up no_dad
129
130	# Sanity check
131	atf_check -s exit:0 -o ignore \
132	    jexec ${j}a ping -6 -c 1 2001:db8::b
133
134	jexec ${j}a pfctl -e
135	pft_set_rules ${j}a \
136		"block proto sctp" \
137		"pass in proto sctp to port 1234"
138
139	echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 &
140
141	# Wait for the server to start
142	sleep 1
143
144	out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1234)
145	if [ "$out" != "foo" ]; then
146		atf_fail "SCTP connection failed"
147	fi
148
149	# Now with scrub rules present, so normalization is done
150	pft_set_rules ${j}a \
151		"scrub on ${j}a" \
152		"block proto sctp" \
153		"pass in proto sctp to port 1234"
154
155	echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 &
156	sleep 1
157
158	out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1234)
159	if [ "$out" != "foo" ]; then
160		atf_fail "SCTP connection failed"
161	fi
162
163	# Now fail with a blocked port
164	echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1235 &
165	sleep 1
166
167	out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1235)
168	if [ "$out" == "foo" ]; then
169		atf_fail "SCTP port block failed"
170	fi
171
172	# Now fail with a blocked port but passing source port
173	out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 2001:db8::a 1235)
174	if [ "$out" == "foo" ]; then
175		atf_fail "SCTP port block failed"
176	fi
177}
178
179basic_v6_cleanup()
180{
181	pft_cleanup
182}
183
184atf_test_case "abort_v4" "cleanup"
185abort_v4_head()
186{
187	atf_set descr 'Test sending ABORT messages'
188	atf_set require.user root
189}
190
191abort_v4_body()
192{
193	sctp_init
194
195	j="sctp:abort_v4"
196	epair=$(vnet_mkepair)
197
198	vnet_mkjail ${j}a ${epair}a
199	vnet_mkjail ${j}b ${epair}b
200
201	jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up
202	jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up
203
204	# Sanity check
205	atf_check -s exit:0 -o ignore \
206	    jexec ${j}a ping -c 1 192.0.2.2
207
208	jexec ${j}a pfctl -e
209	pft_set_rules ${j}a \
210		"block return in proto sctp to port 1234"
211
212	echo "foo" | jexec ${j}a nc --sctp -N -l 1234 &
213
214	# Wait for the server to start
215	sleep 1
216
217	# If we get the abort we'll exit immediately, if we don't timeout will
218	# stop nc.
219	out=$(jexec ${j}b timeout 3 nc --sctp -N 192.0.2.1 1234)
220	if [ $? -eq 124 ]; then
221		atf_fail 'Abort not received'
222	fi
223	if [ "$out" == "foo" ]; then
224		atf_fail "block failed entirely"
225	fi
226
227	# Without 'return' we will time out.
228	pft_set_rules ${j}a \
229		"block in proto sctp to port 1234"
230
231	out=$(jexec ${j}b timeout 3 nc --sctp -N 192.0.2.1 1234)
232	if [ $? -ne 124 ]; then
233		atf_fail 'Abort sent anyway?'
234	fi
235}
236
237abort_v4_cleanup()
238{
239	pft_cleanup
240}
241
242atf_test_case "abort_v6" "cleanup"
243abort_v6_head()
244{
245	atf_set descr 'Test sending ABORT messages over IPv6'
246	atf_set require.user root
247}
248
249abort_v6_body()
250{
251	sctp_init
252
253	j="sctp:abort_v6"
254	epair=$(vnet_mkepair)
255
256	vnet_mkjail ${j}a ${epair}a
257	vnet_mkjail ${j}b ${epair}b
258
259	jexec ${j}a ifconfig ${epair}a inet6 2001:db8::a/64 no_dad
260	jexec ${j}b ifconfig ${epair}b inet6 2001:db8::b/64 no_dad
261
262	# Sanity check
263	atf_check -s exit:0 -o ignore \
264	    jexec ${j}a ping -6 -c 1 2001:db8::b
265
266	jexec ${j}a pfctl -e
267	pft_set_rules ${j}a \
268		"block return in proto sctp to port 1234"
269
270	echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 &
271
272	# Wait for the server to start
273	sleep 1
274
275	# If we get the abort we'll exit immediately, if we don't timeout will
276	# stop nc.
277	out=$(jexec ${j}b timeout 3 nc --sctp -N 2001:db8::a 1234)
278	if [ $? -eq 124 ]; then
279		atf_fail 'Abort not received'
280	fi
281	if [ "$out" == "foo" ]; then
282		atf_fail "block failed entirely"
283	fi
284
285	# Without 'return' we will time out.
286	pft_set_rules ${j}a \
287		"block in proto sctp to port 1234"
288
289	out=$(jexec ${j}b timeout 3 nc --sctp -N 2001:db8::a 1234)
290	if [ $? -ne 124 ]; then
291		atf_fail 'Abort sent anyway?'
292	fi
293}
294
295abort_v6_cleanup()
296{
297	pft_cleanup
298}
299
300atf_test_case "nat_v4" "cleanup"
301nat_v4_head()
302{
303	atf_set descr 'Test NAT-ing SCTP over IPv4'
304	atf_set require.user root
305}
306
307nat_v4_body()
308{
309	sctp_init
310
311	j="sctp:nat_v4"
312	epair_c=$(vnet_mkepair)
313	epair_srv=$(vnet_mkepair)
314
315	vnet_mkjail ${j}srv ${epair_srv}a
316	vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a
317	vnet_mkjail ${j}c ${epair_c}b
318
319	jexec ${j}srv ifconfig ${epair_srv}a 198.51.100.1/24 up
320	# No default route in srv jail, to ensure we're NAT-ing
321	jexec ${j}gw ifconfig ${epair_srv}b 198.51.100.2/24 up
322	jexec ${j}gw ifconfig ${epair_c}a 192.0.2.1/24 up
323	jexec ${j}gw sysctl net.inet.ip.forwarding=1
324	jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up
325	jexec ${j}c route add default 192.0.2.1
326
327	jexec ${j}gw pfctl -e
328	pft_set_rules ${j}gw \
329		"nat on ${epair_srv}b from 192.0.2.0/24 -> (${epair_srv}b)" \
330		"pass"
331
332	# Sanity check
333	atf_check -s exit:0 -o ignore \
334	    jexec ${j}c ping -c 1 198.51.100.1
335
336	echo "foo" | jexec ${j}srv nc --sctp -N -l 1234 &
337
338	# Wait for the server to start
339	sleep 1
340
341	out=$(jexec ${j}c nc --sctp -N -w 3 198.51.100.1 1234)
342	if [ "$out" != "foo" ]; then
343		atf_fail "SCTP connection failed"
344	fi
345}
346
347nat_v4_cleanup()
348{
349	pft_cleanup
350}
351
352atf_test_case "nat_v6" "cleanup"
353nat_v6_head()
354{
355	atf_set descr 'Test NAT-ing SCTP over IPv6'
356	atf_set require.user root
357}
358
359nat_v6_body()
360{
361	sctp_init
362
363	j="sctp:nat_v6"
364	epair_c=$(vnet_mkepair)
365	epair_srv=$(vnet_mkepair)
366
367	vnet_mkjail ${j}srv ${epair_srv}a
368	vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a
369	vnet_mkjail ${j}c ${epair_c}b
370
371	jexec ${j}srv ifconfig ${epair_srv}a inet6 2001:db8::1/64 up no_dad
372	# No default route in srv jail, to ensure we're NAT-ing
373	jexec ${j}gw ifconfig ${epair_srv}b inet6 2001:db8::2/64 up no_dad
374	jexec ${j}gw ifconfig ${epair_c}a inet6 2001:db8:1::1/64 up no_dad
375	jexec ${j}gw sysctl net.inet6.ip6.forwarding=1
376	jexec ${j}c ifconfig ${epair_c}b inet6 2001:db8:1::2/64 up no_dad
377	jexec ${j}c route add -6 default 2001:db8:1::1
378
379	jexec ${j}gw pfctl -e
380	pft_set_rules ${j}gw \
381		"nat on ${epair_srv}b from 2001:db8:1::/64 -> (${epair_srv}b)" \
382		"pass"
383
384	# Sanity check
385	atf_check -s exit:0 -o ignore \
386	    jexec ${j}c ping -6 -c 1 2001:db8::1
387
388	echo "foo" | jexec ${j}srv nc -6 --sctp -N -l 1234 &
389
390	# Wait for the server to start
391	sleep 1
392
393	out=$(jexec ${j}c nc --sctp -N -w 3 2001:db8::1 1234)
394	if [ "$out" != "foo" ]; then
395		atf_fail "SCTP connection failed"
396	fi
397}
398
399nat_v6_cleanup()
400{
401	pft_cleanup
402}
403
404atf_test_case "rdr_v4" "cleanup"
405rdr_v4_head()
406{
407	atf_set descr 'Test rdr SCTP over IPv4'
408	atf_set require.user root
409}
410
411rdr_v4_body()
412{
413	sctp_init
414
415	j="sctp:rdr_v4"
416	epair_c=$(vnet_mkepair)
417	epair_srv=$(vnet_mkepair)
418
419	vnet_mkjail ${j}srv ${epair_srv}a
420	vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a
421	vnet_mkjail ${j}c ${epair_c}b
422
423	jexec ${j}srv ifconfig ${epair_srv}a 198.51.100.1/24 up
424	# No default route in srv jail, to ensure we're NAT-ing
425	jexec ${j}gw ifconfig ${epair_srv}b 198.51.100.2/24 up
426	jexec ${j}gw ifconfig ${epair_c}a 192.0.2.1/24 up
427	jexec ${j}gw sysctl net.inet.ip.forwarding=1
428	jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up
429	jexec ${j}c route add default 192.0.2.1
430
431	jexec ${j}gw pfctl -e
432	pft_set_rules ${j}gw \
433		"rdr pass on ${epair_srv}b proto sctp from 198.51.100.0/24 to any port 1234 -> 192.0.2.2 port 1234" \
434		"pass"
435
436	echo "foo" | jexec ${j}c nc --sctp -N -l 1234 &
437
438	# Wait for the server to start
439	sleep 1
440
441	out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 1234)
442	if [ "$out" != "foo" ]; then
443		atf_fail "SCTP connection failed"
444	fi
445
446	# Despite configuring port changes pf will not do so.
447	echo "bar" | jexec ${j}c nc --sctp -N -l 1234 &
448
449	pft_set_rules ${j}gw \
450		"rdr pass on ${epair_srv}b proto sctp from 198.51.100.0/24 to any port 1234 -> 192.0.2.2 port 4321" \
451		"pass"
452
453	# This will fail
454	out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 4321)
455	if [ "$out" == "bar" ]; then
456		atf_fail "Port was unexpectedly changed."
457	fi
458
459	# This succeeds
460	out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 1234)
461	if [ "$out" != "bar" ]; then
462		atf_fail "Port was unexpectedly changed."
463	fi
464}
465
466rdr_v4_cleanup()
467{
468	pft_cleanup
469}
470
471atf_test_case "pfsync" "cleanup"
472pfsync_head()
473{
474	atf_set descr 'Test pfsync-ing SCTP connections'
475	atf_set require.user root
476}
477
478pfsync_body()
479{
480	# + Builds bellow topology and initiate an SCTP connection
481	#   from client to server.
482	# + Tests that the connection remains open when we fail over from
483	#   router one to router two.
484	#
485	#                   ┌──────┐
486	#                   │client│
487	#                   └───┬──┘
488	#                       │
489	#                   ┌───┴───┐
490	#                   │bridge0│
491	#                   └┬─────┬┘
492	#                    │     │
493	#   ┌────────────────┴─┐ ┌─┴────────────────┐
494	#   │        one       ├─┤       two        │
495	#   └────────────────┬─┘ └─┬────────────────┘
496	#                    │     │
497	#                   ┌┴─────┴┐
498	#                   │bridge1│
499	#                   └───┬───┘
500	#                       │
501	#                   ┌───┴──┐
502	#                   │server│
503	#                   └──────┘
504
505	sctp_init
506	pfsynct_init
507	vnet_init_bridge
508	if ! kldstat -q -m carp
509	then
510		atf_skip "This test requires carp"
511	fi
512
513	j="sctp:pfsync"
514
515	tmp=`pwd`
516
517	bridge0=$(vnet_mkbridge)
518	bridge1=$(vnet_mkbridge)
519
520	epair_c=$(vnet_mkepair)
521	epair_one0=$(vnet_mkepair)
522	epair_two0=$(vnet_mkepair)
523	epair_sync=$(vnet_mkepair)
524	epair_one1=$(vnet_mkepair)
525	epair_two1=$(vnet_mkepair)
526	epair_srv=$(vnet_mkepair)
527
528	ifconfig ${bridge0} addm ${epair_c}a addm ${epair_one0}a addm ${epair_two0}a
529	ifconfig ${epair_one0}a up
530	ifconfig ${epair_two0}a up
531	ifconfig ${epair_c}a up
532	ifconfig ${bridge0} up
533
534	ifconfig ${bridge1} addm ${epair_srv}a addm ${epair_one1}a addm ${epair_two1}a
535	ifconfig ${epair_one1}a up
536	ifconfig ${epair_two1}a up
537	ifconfig ${epair_srv}a up
538	ifconfig ${bridge1} up
539
540	vnet_mkjail ${j}c ${epair_c}b
541	jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up
542	jexec ${j}c route add default 192.0.2.1
543
544	vnet_mkjail ${j}one ${epair_one0}b ${epair_one1}b ${epair_sync}a
545	jexec ${j}one ifconfig ${epair_one0}b 192.0.2.3/24 up
546	jexec ${j}one ifconfig ${epair_one0}b \
547	    alias 192.0.2.1/32 vhid 1 pass 1234
548	jexec ${j}one ifconfig ${epair_one1}b 198.51.100.3/24 up
549	jexec ${j}one ifconfig ${epair_one1}b \
550	    alias 198.51.100.2/32 vhid 2 pass 4321
551	jexec ${j}one ifconfig ${epair_sync}a 203.0.113.1/24 up
552	jexec ${j}one ifconfig pfsync0 \
553		syncdev ${epair_sync}a \
554		maxupd 1 \
555		up
556	jexec ${j}one sysctl net.inet.ip.forwarding=1
557
558	vnet_mkjail ${j}two ${epair_two0}b ${epair_two1}b ${epair_sync}b
559	jexec ${j}two ifconfig ${epair_two0}b 192.0.2.4/24 up
560	jexec ${j}two ifconfig ${epair_two0}b \
561	    alias 192.0.2.1/32 vhid 1 pass 1234
562	jexec ${j}two ifconfig ${epair_two1}b 198.51.100.4/24 up
563	jexec ${j}two ifconfig ${epair_two1}b \
564	    alias 198.51.100.2/32 vhid 2 pass 4321
565	jexec ${j}two ifconfig ${epair_sync}b 203.0.113.2/24 up
566	jexec ${j}two ifconfig pfsync0 \
567		syncdev ${epair_sync}b \
568		maxupd 1 \
569		up
570	jexec ${j}two sysctl net.inet.ip.forwarding=1
571
572	vnet_mkjail ${j}srv ${epair_srv}b
573	jexec ${j}srv ifconfig ${epair_srv}b 198.51.100.1/24 up
574	jexec ${j}srv route add default 198.51.100.2
575
576	# Demote two, to avoid dealing with asymmetric routing
577	jexec ${j}two sysctl net.inet.carp.demotion=50
578
579	jexec ${j}one pfctl -e
580	pft_set_rules ${j}one \
581		"block all" \
582		"pass proto { icmp, pfsync, carp }" \
583		"pass proto sctp to port 1234" \
584		"pass proto tcp to port 1234"
585
586	jexec ${j}two pfctl -e
587	pft_set_rules ${j}two \
588		"block all" \
589		"pass proto { icmp, pfsync, carp }" \
590		"pass proto sctp to port 1234" \
591		"pass proto tcp to port 1234"
592
593	# Give carp time to get set up
594	sleep 2
595
596	# Sanity check
597	atf_check -s exit:0 -o ignore \
598	    jexec ${j}c ping -c 1 198.51.100.1
599
600	# Now start up an SCTP connection
601	touch ${tmp}/input
602	tail -F ${tmp}/input | jexec ${j}srv nc --sctp -l 1234 &
603	sleep 1
604
605	jexec ${j}c nc --sctp 198.51.100.1 1234 > ${tmp}/output &
606	echo "1" >> ${tmp}/input
607
608	# Give time for the traffic to arrive
609	sleep 1
610	line=$(tail -n -1 ${tmp}/output)
611	if [ "${line}" != "1" ];
612	then
613		echo "Found ${line}"
614		cat ${tmp}/output
615		atf_fail "Initial SCTP connection failed"
616	fi
617
618	# Verify that two has the connection too
619	state=$(jexec ${j}two pfctl -ss | grep sctp)
620	if [ -z "${state}" ];
621	then
622		jexec ${j}two pfctl -ss
623		atf_fail "Failed to find SCTP state on secondary pfsync host"
624	fi
625
626	# Now fail over (both carp IPs should switch here)
627	jexec ${j}one sysctl net.inet.carp.demotion=100
628
629	while ! jexec ${j}one ifconfig ${epair_one0}b | grep MASTER;
630	do
631		sleep 1
632	done
633	while ! jexec ${j}one ifconfig ${epair_one1}b | grep MASTER;
634	do
635		sleep 1
636	done
637
638	# Sanity check
639	atf_check -s exit:0 -o ignore \
640	    jexec ${j}c ping -c 1 198.51.100.1
641
642	# And check that the connection is still live
643	echo "2" >> ${tmp}/input
644	sleep 1
645	line=$(tail -n -1 ${tmp}/output)
646	if [ "${line}" != "2" ];
647	then
648		echo "Found ${line}"
649		cat ${tmp}/output
650		atf_fail "SCTP failover failed"
651	fi
652}
653
654pfsync_cleanup()
655{
656	pfsynct_cleanup
657}
658
659atf_test_case "timeout" "cleanup"
660timeout_head()
661{
662	atf_set descr 'Test setting and retrieving timeout values'
663	atf_set require.user root
664}
665
666timeout_body()
667{
668	sctp_init
669}
670
671timeout_cleanup()
672{
673	pft_cleanup
674
675	vnet_mkjail timeout
676
677	pft_set_rules timeout \
678		"set timeout sctp.first 13" \
679		"set timeout sctp.opening 14"
680
681	atf_check -s exit:0 -o match:"sctp.first.*13" \
682	    jexec timeout pfctl -st
683	atf_check -s exit:0 -o match:"sctp.opening.*14" \
684	    jexec timeout pfctl -st
685	# We've not changed other timeouts
686	atf_check -s exit:0 -o match:"sctp.established.*86400" \
687	    jexec timeout pfctl -st
688}
689
690atf_init_test_cases()
691{
692	atf_add_test_case "basic_v4"
693	atf_add_test_case "basic_v6"
694	atf_add_test_case "abort_v4"
695	atf_add_test_case "abort_v6"
696	atf_add_test_case "nat_v4"
697	atf_add_test_case "nat_v6"
698	atf_add_test_case "rdr_v4"
699	atf_add_test_case "pfsync"
700	atf_add_test_case "timeout"
701}
702