pf tests: explicitly test zeroing counters within an anchor

While here fix the match pattern in the existing test.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost
2026-04-07 16:07:45 +02:00
parent cff675e83c
commit 6642ba36f1
+13 -1
View File
@@ -352,8 +352,20 @@ counter_body()
# Generate traffic
atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1
atf_check -s exit:0 -e ignore \
-o match:'[ Evaluations: 1 Packets: 2 Bytes: 168 States: 1 ]' \
-o match:'\[ Evaluations: 1 Packets: 2 Bytes: 168 States: 1 \]' \
jexec alcatraz pfctl -sr -vv
# Zero counters outside of the anchor
jexec alcatraz pfctl -sr -vv -z
atf_check -s exit:0 -e ignore \
-o match:'\[ Evaluations: 1 Packets: 2 Bytes: 168 States: 1 \]' \
jexec alcatraz pfctl -sr -vv -a "foo"
# Zero the anchor's counters
jexec alcatraz pfctl -sr -vv -z -a "foo"
atf_check -s exit:0 -e ignore \
-o match:'\[ Evaluations: 0 Packets: 0 Bytes: 0 States: 1 \]' \
jexec alcatraz pfctl -sr -vv -a "foo"
}
counter_cleanup()