aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2024-06-06 15:50:42 +0000
committerKristof Provost <kp@FreeBSD.org>2024-07-25 08:23:29 +0000
commit5acd8ff56604d1a4263c3775d14024fa055c52f8 (patch)
treee8c61fba7fe97758305faf255f9954c2b0e9df81
parent4842a15fa43ba66ec581daa51a1bbaa3a22f93fa (diff)
downloadsrc-5acd8ff56604d1a4263c3775d14024fa055c52f8.tar.gz
src-5acd8ff56604d1a4263c3775d14024fa055c52f8.zip
pf tests: test setting and retrieving timeout values
(cherry picked from commit 8ed5170c66ec4914e90c2f3657227ceb9e35193f)
-rw-r--r--tests/sys/netpfil/pf/sctp.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh
index c6dba1719d00..c3e1301238b0 100644
--- a/tests/sys/netpfil/pf/sctp.sh
+++ b/tests/sys/netpfil/pf/sctp.sh
@@ -656,6 +656,37 @@ pfsync_cleanup()
pfsynct_cleanup
}
+atf_test_case "timeout" "cleanup"
+timeout_head()
+{
+ atf_set descr 'Test setting and retrieving timeout values'
+ atf_set require.user root
+}
+
+timeout_body()
+{
+ sctp_init
+}
+
+timeout_cleanup()
+{
+ pft_cleanup
+
+ vnet_mkjail timeout
+
+ pft_set_rules timeout \
+ "set timeout sctp.first 13" \
+ "set timeout sctp.opening 14"
+
+ atf_check -s exit:0 -o match:"sctp.first.*13" \
+ jexec timeout pfctl -st
+ atf_check -s exit:0 -o match:"sctp.opening.*14" \
+ jexec timeout pfctl -st
+ # We've not changed other timeouts
+ atf_check -s exit:0 -o match:"sctp.established.*86400" \
+ jexec timeout pfctl -st
+}
+
atf_init_test_cases()
{
atf_add_test_case "basic_v4"
@@ -666,4 +697,5 @@ atf_init_test_cases()
atf_add_test_case "nat_v6"
atf_add_test_case "rdr_v4"
atf_add_test_case "pfsync"
+ atf_add_test_case "timeout"
}