git: 5131335c7d48 - main - pf tests: test pfTablesTblCount in snmp_pf

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Thu, 19 Nov 2026 16:59:53 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=5131335c7d48eaec427aa9ed27862ca56e3e95bc

commit 5131335c7d48eaec427aa9ed27862ca56e3e95bc
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-11-18 16:48:48 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-11-19 16:59:21 +0000

    pf tests: test pfTablesTblCount in snmp_pf
    
    This works fine on main, but not on stable/15 so add a test.
    
    PR:     300818
    MFC after:      3 days
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 tests/sys/netpfil/pf/snmp.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/sys/netpfil/pf/snmp.sh b/tests/sys/netpfil/pf/snmp.sh
index ad80fd457bb1..190e266f968e 100644
--- a/tests/sys/netpfil/pf/snmp.sh
+++ b/tests/sys/netpfil/pf/snmp.sh
@@ -100,6 +100,19 @@ table_body()
 	atf_check -s exit:0 -o match:'pfTablesTblNumber.0 = 1' \
 	    bsnmpwalk -s public@192.0.2.1 -i pf_tree.def begemot
 
+	# With one address in it
+	atf_check -s exit:0 -o match:'pfTablesTblCount.* = 1' \
+	    bsnmpwalk -s public@192.0.2.1 -i pf_tree.def pfTables
+
+	jexec alcatraz pfctl -T add -t foo 198.51.100.0/24
+
+	# Give bsnmp time to refresh the table
+	sleep 6
+
+	# And now there are two
+	atf_check -s exit:0 -o match:'pfTablesTblCount.* = 2' \
+	    bsnmpwalk -s public@192.0.2.1 -i pf_tree.def pfTables
+
 	# We have the 'foo' table
 	atf_check -s exit:0 -o match:'pfTablesTblDescr.* = foo' \
 	    bsnmpwalk -s public@192.0.2.1 -i pf_tree.def pfTables