From f9e5e946042b2d06dd058cc743da3c7cf1fbd0be Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Fri, 26 Apr 2019 12:59:23 +0000 Subject: [PATCH] MFC r346347: pf tests: Fail the test if we can't set the rules The test should fail if pf rules can't be set. This is helpful both while writing tests and to verify that pfctl works as expected. --- tests/sys/netpfil/pf/utils.subr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index 915aba318d1..34236335d44 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -40,6 +40,10 @@ pft_set_rules() printf "$1\n" shift done | jexec ${jname} pfctl -f - + if [ $? -ne 0 ]; + then + atf_fail "Failed to set PF rules in ${jname}" + fi } pft_cleanup() -- 2.45.0