aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2021-07-27 13:31:00 +0000
committerKristof Provost <kp@FreeBSD.org>2021-07-30 07:51:04 +0000
commitefe3bf0fb092ebf79c04c760b8b6d703817c37c0 (patch)
treefb3962d5c31e94212deb5c7d3b11b7c05d78ff5c
parent057275e4be560e02b5ba31918dc262beb474188d (diff)
downloadsrc-efe3bf0fb092ebf79c04c760b8b6d703817c37c0.tar.gz
src-efe3bf0fb092ebf79c04c760b8b6d703817c37c0.zip
pf tests: make killstate:match more robust
Only lists the states relevant to the connection we're killing. Sometimes there are IPv6 related states (due to the usual IPv6 background traffic of router solicitations, DAD, ...) that causes us to think we failed to kill the state, which in turn caused the test to fail intermittently. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 4e860bd5da1423aac9aed0541c484ebf9c1d1621)
-rw-r--r--tests/sys/netpfil/pf/killstate.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh
index f53ede8c7578..e140ee4d144d 100644
--- a/tests/sys/netpfil/pf/killstate.sh
+++ b/tests/sys/netpfil/pf/killstate.sh
@@ -426,7 +426,7 @@ match_body()
wait_for_state alcatraz 192.0.2.1
# Expect two states
- states=$(jexec alcatraz pfctl -s s | wc -l)
+ states=$(jexec alcatraz pfctl -s s | grep 192.0.2.1 | wc -l)
if [ $states -ne 2 ] ;
then
atf_fail "Expected two states, found $states"
@@ -434,7 +434,7 @@ match_body()
# If we don't kill the matching NAT state one should be left
jexec alcatraz pfctl -k 192.0.2.1
- states=$(jexec alcatraz pfctl -s s | wc -l)
+ states=$(jexec alcatraz pfctl -s s | grep 192.0.2.1 | wc -l)
if [ $states -ne 1 ] ;
then
atf_fail "Expected one states, found $states"
@@ -448,7 +448,7 @@ match_body()
# Kill matching states, expect all of them to be gone
jexec alcatraz pfctl -M -k 192.0.2.1
- states=$(jexec alcatraz pfctl -s s | wc -l)
+ states=$(jexec alcatraz pfctl -s s | grep 192.0.2.1 | wc -l)
if [ $states -ne 0 ] ;
then
atf_fail "Expected zero states, found $states"