aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2025-08-25 13:44:11 +0000
committerKristof Provost <kp@FreeBSD.org>2025-09-17 14:15:15 +0000
commit7eb30b26aa12cf1b80b6a784ccbd0b6f648f4529 (patch)
tree88abee3cef0618e17b85f9cbb46dea5f4c2ebcbc
parent9d9bc7f462bd152d87ab8f1767cad19bab09bf8b (diff)
pf tests: test set limit
Verify that 'set limit anchors' now has the expected effect. Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r--tests/sys/netpfil/pf/limits.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/limits.sh b/tests/sys/netpfil/pf/limits.sh
index 69f0b6af2ccf..a0d6b891ee19 100644
--- a/tests/sys/netpfil/pf/limits.sh
+++ b/tests/sys/netpfil/pf/limits.sh
@@ -112,8 +112,43 @@ zero_cleanup()
pft_cleanup
}
+atf_test_case "anchors" "cleanup"
+anchors_head()
+{
+ atf_set descr 'Test increasing maximum number of anchors'
+ atf_set require.user root
+}
+
+anchors_body()
+{
+ pft_init
+
+ vnet_mkjail alcatraz
+
+ jexec alcatraz pfctl -e
+
+ pft_set_rules alcatraz \
+ "set limit anchors 1"
+
+ pft_set_rules alcatraz \
+ "set limit anchors 2" \
+ "pass" \
+ "anchor \"foo\" {\n
+ pass in\n
+ }" \
+ "anchor \"bar\" {\n
+ pass out\n
+ }"
+}
+
+anchors_cleanup()
+{
+ pft_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "basic"
atf_add_test_case "zero"
+ atf_add_test_case "anchors"
}