Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Dec 2025 13:17:14 +0000
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2eec2bcca297 - main - pf tests: avoid cleanup failures on skipped tests
Message-ID:  <6953d0da.3c163.726cd9e1@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=2eec2bcca2972b58fb8e9acb65c208af423f2181

commit 2eec2bcca2972b58fb8e9acb65c208af423f2181
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-12-30 10:30:15 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-12-30 13:16:53 +0000

    pf tests: avoid cleanup failures on skipped tests
    
    If we skip the nat:binat_* tests (e.g. because pf.ko isn't loaded) the
    inetd_tester.pid file isn't created. We still run the cleanup function,
    which tries to use this file to clean up the test environment. This
    results in 'broken: Test case cleanup did not terminate successfully'.
    Avoid this by checking if the pid file exists before using it.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 tests/sys/netpfil/pf/nat.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh
index 3d953b495953..025471f75f97 100644
--- a/tests/sys/netpfil/pf/nat.sh
+++ b/tests/sys/netpfil/pf/nat.sh
@@ -804,8 +804,8 @@ binat_compat_body()
 
 binat_compat_cleanup()
 {
+	[ -f ${PWD}/inetd_tester.pid ] && kill $(cat ${PWD}/inetd_tester.pid)
 	pft_cleanup
-	kill $(cat ${PWD}/inetd_tester.pid)
 }
 
 atf_test_case "binat_match" "cleanup"
@@ -872,8 +872,8 @@ binat_match_body()
 
 binat_match_cleanup()
 {
+	[ -f ${PWD}/inetd_tester.pid ] && kill $(cat ${PWD}/inetd_tester.pid)
 	pft_cleanup
-	kill $(cat ${PWD}/inetd_tester.pid)
 }
 
 atf_test_case "empty_pool" "cleanup"


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6953d0da.3c163.726cd9e1>