summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2020-12-02 16:33:23 +0000
committerKristof Provost <kp@FreeBSD.org>2020-12-02 16:33:23 +0000
commite997614fd283b2750cf087f4628323190a8262e1 (patch)
tree4c6394cd34454484752ca8e0e382665e2ca65069 /tests
parente6aed06fdfa8b1106ff4b4b1fdb60c7b46358688 (diff)
downloadsrc-test-e997614fd283b2750cf087f4628323190a8262e1.tar.gz
src-test-e997614fd283b2750cf087f4628323190a8262e1.zip
pf tests: Test case for bug #251414
Changing a table from not having counters to having counters (or vice versa) may trigger panics. PR: 251414 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27441
Notes
Notes: svn path=/head/; revision=368277
Diffstat (limited to 'tests')
-rw-r--r--tests/sys/netpfil/pf/table.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh
index af2691067f523..9003f61ba1897 100644
--- a/tests/sys/netpfil/pf/table.sh
+++ b/tests/sys/netpfil/pf/table.sh
@@ -108,8 +108,47 @@ v6_counters_cleanup()
pft_cleanup
}
+atf_test_case "pr251414" "cleanup"
+pr251414_head()
+{
+ atf_set descr 'Test PR 251414'
+ atf_set require.user root
+}
+
+pr251414_body()
+{
+ pft_init
+
+ epair_send=$(vnet_mkepair)
+ ifconfig ${epair_send}a 192.0.2.1/24 up
+
+ vnet_mkjail alcatraz ${epair_send}b
+ jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up
+ jexec alcatraz pfctl -e
+
+ pft_set_rules alcatraz \
+ "pass all" \
+ "table <tab> { self }" \
+ "pass in log to <tab>"
+
+ pft_set_rules noflush alcatraz \
+ "pass all" \
+ "table <tab> counters { self }" \
+ "pass in log to <tab>"
+
+ atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2
+
+ jexec alcatraz pfctl -t tab -T show -vv
+}
+
+pr251414_cleanup()
+{
+ pft_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "v4_counters"
atf_add_test_case "v6_counters"
+ atf_add_test_case "pr251414"
}