From 34478b73bf18e4f13b6053f6f338c78f782a1df8 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Tue, 1 Feb 2022 18:33:42 +0100 Subject: [PATCH] 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 --- tests/sys/netpfil/pf/utils.subr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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