From nobody Wed Dec 28 09:03:15 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NhltC2NYFz2cHh3; Wed, 28 Dec 2022 09:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NhltC1jtRz46gK; Wed, 28 Dec 2022 09:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672218195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XrST7Shddfzo3hxt2MBFbKDxHurXrZAmFMyNahpCmJc=; b=O4pbihK414qAPz1FWq/UaVP4R9JiNax9IUQ78gERDzygQWK/U9QuOxyZBqID4ss/iTeSLQ Zy3I9Oxo76sDXINADp8pIP8GuNSBSH1iCk30qTlwuqD8VHvc+UK6xIRLmFy4OEdUFch6nO NTsXNSIlgyf0+C+L4JPaa20aDWgTweluycIR4+W3KD2xaiG8LU/lJSBNQO4M0ZNYWjTlVf 3b7NKvJd5QaygGJ2TJ1WyA6F95n3bi6f77TF2qMH9hp7Nx+EaMywZ5dFzcK9C/8+AbV6oH q37Cr513TV/XVjekZq8+nbLHAj3hl2ItPmJyndYwWKjcusmMJx0/5vYZY12K4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672218195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XrST7Shddfzo3hxt2MBFbKDxHurXrZAmFMyNahpCmJc=; b=Jb11IH2otEaHmWYQFoZzC5CHp+/jyA4UDc906rKhFAodwZk8XrNJSyee0hlBZUJ2uVwYGG LG2bBlxj4+YLo7YVQsiQ2fhMPNuvV517T5X/inmFIx8j6ouc+pzNlCjNXfPlmE/2WyZeJL lm1PZ5al69+Zq7Mxg78ryiOv/ZLdVDxWeCYdNGvPs4F+Sh/mZoY14J6NjNg0hVZyTiXxLq oVyheI43TyinreiEShZsrFpCWdeAdDf3cmpaW/3xSm5h1WaKg4sZumZZ+oMIa8fg2JsNoW 12J/8c9tbslACY4jPi8HFeVltP2ZDsRrp6q3D5r/SxR6QcSLZMA/2oJ0LR5kzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672218195; a=rsa-sha256; cv=none; b=LqV4NzZcnlK/p3rQIrcOwLdBsGO7c1oIxEgSzy5IGWSNQmNiSDkyCdAUfQZFykslTQBgU7 fzTjWnzwEnn8nK7BPJL5eOdvVRKKDYFiqQfampn3PXGX+1ieDYtcRfhaw/ZdLsEyKTu4sA HisbzLzasYptbReVZRWXLeTLVEAp8u5QrE/d1x8oMvFsdEkxGYpVHzgXhYxfvfrJVVuNjY OzPw4wO3LHl4ISCL4aVyYI658oxYXvbsb2R6xB8FLWzhin/Ryp2hl/NKwMthfZmkYXjOzl IBG62V6XEYcZHOsL81UY98q+Ms7WdPtR9y3CUTh79x3jEgr6kJawamcS7QuXIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NhltC0pF8zkMX; Wed, 28 Dec 2022 09:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BS93FYk058540; Wed, 28 Dec 2022 09:03:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BS93Fhe058539; Wed, 28 Dec 2022 09:03:15 GMT (envelope-from git) Date: Wed, 28 Dec 2022 09:03:15 GMT Message-Id: <202212280903.2BS93Fhe058539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e0724177b584 - stable/12 - pf tests: check that we clean up unused kifs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e0724177b5840c7f89efc00201fc5c4f4dc66fc5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e0724177b5840c7f89efc00201fc5c4f4dc66fc5 commit e0724177b5840c7f89efc00201fc5c4f4dc66fc5 Author: Kristof Provost AuthorDate: 2022-11-30 14:20:41 +0000 Commit: Kristof Provost CommitDate: 2022-12-28 05:06:13 +0000 pf tests: check that we clean up unused kifs The previous commit fixed a memory leak, where we'd fail to clean up removed groups (and interfaces). Check that we now clean those up as expected. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D37570 (cherry picked from commit 654e8d84ec8bcb3d94cd8de69edecbe1bbd73eb8) --- tests/sys/netpfil/pf/names.sh | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/sys/netpfil/pf/names.sh b/tests/sys/netpfil/pf/names.sh index b2102d644312..e3fb3eb56103 100755 --- a/tests/sys/netpfil/pf/names.sh +++ b/tests/sys/netpfil/pf/names.sh @@ -53,7 +53,51 @@ names_cleanup() pft_cleanup } +atf_test_case "group" "cleanup" +group_head() +{ + atf_set descr 'Test group cleanup, PR257218' + atf_set require.user root +} + +group_body() +{ + pft_init + + vnet_mkjail alcatraz + + if [ -n "$(jexec alcatraz pfctl -sI | grep '^epair$')" ]; + then + atf_fail "Unexpected epair group" + fi + + epair=$(vnet_mkepair) + if [ -n "$(jexec alcatraz pfctl -sI | grep '^epair$')" ]; + then + atf_fail "Unexpected epair group" + fi + + ifconfig ${epair}b vnet alcatraz + if [ -z "$(jexec alcatraz pfctl -sI | grep '^epair$')" ]; + then + atf_fail "Failed to find epair group" + fi + + ifconfig ${epair}a destroy + + if [ -n "$(jexec alcatraz pfctl -sI | grep '^epair$')" ]; + then + atf_fail "Unexpected epair group" + fi +} + +group_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "names" + atf_add_test_case "group" }