Skip to content

Commit 466399f

Browse files
committed
selftests: netfilter: Run nft_audit.sh in its own netns
JIRA: https://issues.redhat.com/browse/RHEL-9127 This patch is a backport of the following upstream commit: commit 2e2d9c7 Author: Phil Sutter <[email protected]> Date: Fri Oct 13 22:02:24 2023 +0200 selftests: netfilter: Run nft_audit.sh in its own netns 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: e8dbde5 ("selftests: netfilter: Test nf_tables audit logging") Signed-off-by: Phil Sutter <[email protected]> Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Ricardo Robaina <[email protected]>
1 parent f3e8ce5 commit 466399f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/testing/selftests/netfilter/nft_audit.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ nft --version >/dev/null 2>&1 || {
1111
exit $SKIP_RC
1212
}
1313

14+
# Run everything in a separate network namespace
15+
[ "${1}" != "run" ] && { unshare -n "${0}" run; exit $?; }
16+
17+
# give other scripts a chance to finish - audit_logread sees all activity
18+
sleep 1
19+
1420
logfile=$(mktemp)
1521
rulefile=$(mktemp)
1622
echo "logging into $logfile"

0 commit comments

Comments
 (0)