Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Dec 2020 17:17:45 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r368488 - stable/12/tests/sys/netpfil/pf
Message-ID:  <202012091717.0B9HHj6H069348@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Wed Dec  9 17:17:45 2020
New Revision: 368488
URL: https://svnweb.freebsd.org/changeset/base/368488

Log:
  MFC r368277:
  
  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

Modified:
  stable/12/tests/sys/netpfil/pf/table.sh
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/netpfil/pf/table.sh
==============================================================================
--- stable/12/tests/sys/netpfil/pf/table.sh	Wed Dec  9 15:28:56 2020	(r368487)
+++ stable/12/tests/sys/netpfil/pf/table.sh	Wed Dec  9 17:17:45 2020	(r368488)
@@ -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"
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012091717.0B9HHj6H069348>