From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77674C001E0 for ; Mon, 23 Oct 2023 11:05:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233303AbjJWLFz (ORCPT ); Mon, 23 Oct 2023 07:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233317AbjJWLFx (ORCPT ); Mon, 23 Oct 2023 07:05:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48F86D7A for ; Mon, 23 Oct 2023 04:05:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 800E6C433CA; Mon, 23 Oct 2023 11:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698059150; bh=Ljhi2M/Z2Ol53POLdJxHqe0SOuoanpVo59AXNwp3ios=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2pV9WcSdQMdWgWTE3YsEGRAbrPV3RHezdk4Cx5spw+TTmVZyLk2w7OnKkWchvLIgY D3JnbLMvX9OKwWoRjFw+BgZu802uvwTzMWjWwcK7eZ1oqjtfB6U6uvvn1SffQMgkF/ Lv0BucDL2DV9VThSERIpi17eOlPDjjvZ55QTLngA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Phil Sutter , Florian Westphal Subject: [PATCH 6.5 080/241] selftests: netfilter: Run nft_audit.sh in its own netns Date: Mon, 23 Oct 2023 12:54:26 +0200 Message-ID: <20231023104835.836931451@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231023104833.832874523@linuxfoundation.org> References: <20231023104833.832874523@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Phil Sutter commit 2e2d9c7d4d37d74873583d7b0c94eac8b6869486 upstream. Don't mess with the host's firewall ruleset. Since audit logging is not per-netns, add an initial delay of a second so other selftests' netns cleanups have a chance to finish. Fixes: e8dbde59ca3f ("selftests: netfilter: Test nf_tables audit logging") Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/netfilter/nft_audit.sh | 6 ++++++ 1 file changed, 6 insertions(+) --- a/tools/testing/selftests/netfilter/nft_audit.sh +++ b/tools/testing/selftests/netfilter/nft_audit.sh @@ -11,6 +11,12 @@ nft --version >/dev/null 2>&1 || { exit $SKIP_RC } +# Run everything in a separate network namespace +[ "${1}" != "run" ] && { unshare -n "${0}" run; exit $?; } + +# give other scripts a chance to finish - audit_logread sees all activity +sleep 1 + logfile=$(mktemp) rulefile=$(mktemp) echo "logging into $logfile"