From nobody Wed Dec 28 09:07:22 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 4Nhlyz17HPz2cJ0Y; Wed, 28 Dec 2022 09:07:23 +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 4Nhlyz0L1bz47cs; Wed, 28 Dec 2022 09:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672218443; 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=aCambvJ+MVrWvhy4nhfdF2L5CrxfzXYOZABYtlISoZU=; b=vi0genlhvm6fhxe/ivWYr3MOFsnFyrw+D5rDJd1V36anoxnQ9c+bmHzWiRNKRde6XtmNfJ 6oFPQqyehS4V+H6t/QbxMpYuOXOJ+lJ12xEmJHgU/a1fBjWRBg57LKX/UAoMU0aSEdaxla 6EZJ2mf1Ihpyi6n8nXDSYjJqQpJdxFV/bgDwjtRI/04yiiLiAxmhas57iNsc0kgxSdVxZv rPvShg3fy6sh4cG8h94f7MKF5uX4XhPxXP0KxtlSr/Gi+yS3OqI+gSSEgHdjSbcwcxGiJh +rv4WfGFK81GnaLkmh9R3n+6rSx6ZBe53ChdgdYJRuz07OuqYSM+6hItv/EsZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672218443; 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=aCambvJ+MVrWvhy4nhfdF2L5CrxfzXYOZABYtlISoZU=; b=tRUCrdqnJeMFVft+UaSMBlwC03OeJn1Jm0Hi+6TO+4Y8jn0zJAUSiM/ZG9yvuIYJ4Lan2a LMnOmhFWCaNxMZXICCocdlWN41tE2mg609HKS9RQsUIeV1GurxRtrip8J+98reIPYyIYiF MLNEhciCtqWp50d84J29MbC2IR9H2pxARDz/YrV2Y4DOxCj3xcGULCHidOcYbejH+kj0gA AxqwSp9b3yyCagFBOdTFppucIrYESHVQX9gZzy7dEyn3o8XFU2+2gF5xBXXo01NL6ccdzg mB3fDraPJt6bxSY0mqa3C1xqQvaqLnYVQ2wLuXAz4DW3qPJXwiqJNU1r+gyscQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672218443; a=rsa-sha256; cv=none; b=VHpU2Mqp0u2oiBqM+ueRqXhn0X5Omglqgsu64oZ1MkDc8Sbrhfjz+NV4uJgtsAY5c/9pwO Lt0DVf6shdOVLwV7Hm6rAP6YczlhCxY5MbJWHQnXU6kAYRCf8jS84LuWHfEqPXaLH0IxJr VyC3g3Rrmzb74i1Fo6q0oasM/o51SsJ8eSqfSdzevftCtn1wth8a0dPXnaHsVNj39+/JxC e/aGkeK1X73SwvEtVR4jXHLfOpzKLQ5lc4mABDuVWs3cj2cD5unwwaWUBsV6lIXZWd5l3b 1ehaE9zA+RHRWdg9sn/70C4LNPkzYNAqfYdbZyyi4BFiL9YnjS02hbrIhrkPmA== 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 4Nhlyy6FQtzkPc; Wed, 28 Dec 2022 09:07:22 +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 2BS97Me3059231; Wed, 28 Dec 2022 09:07:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BS97MWR059230; Wed, 28 Dec 2022 09:07:22 GMT (envelope-from git) Date: Wed, 28 Dec 2022 09:07:22 GMT Message-Id: <202212280907.2BS97MWR059230@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: 16603f60156e - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 16603f60156e13ea47e66b2fdcc391bb13db7dee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=16603f60156e13ea47e66b2fdcc391bb13db7dee commit 16603f60156e13ea47e66b2fdcc391bb13db7dee Author: Kristof Provost AuthorDate: 2022-11-30 14:20:41 +0000 Commit: Kristof Provost CommitDate: 2022-12-28 05:06:20 +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 100644 --- 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" }