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.

MFC after:	1 week
Event:		Aberdeen hackathon 2019
This commit is contained in:
kp 2019-04-18 10:54:08 +00:00
parent 3fc25ab528
commit 6141530607

View File

@ -40,6 +40,10 @@ pft_set_rules()
printf "$1\n" printf "$1\n"
shift shift
done | jexec ${jname} pfctl -f - done | jexec ${jname} pfctl -f -
if [ $? -ne 0 ];
then
atf_fail "Failed to set PF rules in ${jname}"
fi
} }
pft_cleanup() pft_cleanup()