aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2022-02-01 17:33:42 +0000
committerKristof Provost <kp@FreeBSD.org>2022-02-05 09:31:51 +0000
commit34478b73bf18e4f13b6053f6f338c78f782a1df8 (patch)
treeef616ea8b0779457cb21ac3a269024ac1c208777
parent109418996514111d887b6790c617cbc7cc3f41a5 (diff)
downloadsrc-34478b73bf18e4f13b6053f6f338c78f782a1df8.tar.gz
src-34478b73bf18e4f13b6053f6f338c78f782a1df8.zip
pf tests: Only do post-test logging when specifically enabled
The pf tests have the ability to log state information (pf rules, pf states, interfaces, ...) on exit (i.e. on success or on error). This is useful, but only in specific cases. When it's not needed it may get in the way of clear output. Test scripts can add 'debug' to the pft_init call to enable this for the specified test. Reviewed by: brd Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34133
-rw-r--r--tests/sys/netpfil/pf/utils.subr5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr
index 9afd6280707e..a010374993ff 100644
--- a/tests/sys/netpfil/pf/utils.subr
+++ b/tests/sys/netpfil/pf/utils.subr
@@ -59,7 +59,10 @@ pft_onerror()
pft_init()
{
- trap pft_onerror EXIT
+ if [ "$1" == "debug" ]
+ then
+ trap pft_onerror EXIT
+ fi
vnet_init