selftests: netfilter: Fix skip of wildcard interface test
Subsystems (4)
Phil Sutter
reviewerPATCH 1/1 selftests: netfilter: Fix skip of wildcard interface test
The script is supposed to skip wildcard interface testing if unsupported by the host's nft tool. The failing check caused script abort due to 'set -e' though. Fix this by running the potentially failing nft command inside the if-conditional pipe.
--- .../selftests/net/netfilter/nft_interface_stress.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
tools/testing/selftests/net/netfilter/nft_interface_stress.sh +5 -2
@@ -97,7 +97,8 @@ kill $nft_monitor_pid kill $rename_loop_pid wait -ip netns exec $nsr nft -f - <<EOF +wildcard_prep() { + ip netns exec $nsr nft -f - <<EOF table ip t { flowtable ft_wild { hook ingress priority 0
@@ -105,7 +106,9 @@ table ip t { } } EOF -if [[ $? -ne 0 ]]; then +} + +if ! wildcard_prep; then echo "SKIP wildcard tests: not supported by host's nft?" else for ((i = 0; i < 100; i++)); do
Signature · 1 line
2.49.0
Quoted 4 lines · Phil Sutter
The script is supposed to skip wildcard interface testing if unsupported by the host's nft tool. The failing check caused script abort due to 'set -e' though. Fix this by running the potentially failing nft command inside the if-conditional pipe.
Thanks Phil, this is an easy fix for this.
Quoted 2 lines
Fixes 73db1b5dab6f ("selftests: netfilter: Torture nftables netdev hooks")Signed-off-by Phil Sutter <[email protected]>
Paolo, you can take this now to calm down CI. Thanks
Quoted 32 lines
--- .../selftests/net/netfilter/nft_interface_stress.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)tools/testing/selftests/net/netfilter/nft_interface_stress.sh +5
-2@@ -97,7 +97,8 @@ kill $nft_monitor_pid kill $rename_loop_pid wait -ip netns exec $nsr nft -f - <<EOF +wildcard_prep() { + ip netns exec $nsr nft -f - <<EOF table ip t { flowtable ft_wild { hook ingress priority 0@@ -105,7 +106,9 @@ table ip t { } } EOF -if [[ $? -ne 0 ]]; then +} + +if ! wildcard_prep; then echo "SKIP wildcard tests: not supported by host's nft?" else for ((i = 0; i < 100; i++)); doSignature · 1 line
2.49.0
Paolo Abeni
maintainerQuoted 7 lines · Phil Sutter
The script is supposed to skip wildcard interface testing if unsupported by the host's nft tool. The failing check caused script abort due to 'set -e' though. Fix this by running the potentially failing nft command inside the if-conditional pipe.
Fixes 73db1b5dab6f ("selftests: netfilter: Torture nftables netdev hooks")Signed-off-by Phil Sutter <[email protected]>
FTR I'm applying this patch below the 24h grace period to avoid sending a net-next PR with known issue and known unapplied fix.
/P
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 9 lines · On Tue, 27 May 2025 11:41:17 +0200 you wrote:
The script is supposed to skip wildcard interface testing if unsupported by the host's nft tool. The failing check caused script abort due to 'set -e' though. Fix this by running the potentially failing nft command inside the if-conditional pipe.
Fixes 73db1b5dab6f ("selftests: netfilter: Torture nftables netdev hooks")Signed-off-by Phil Sutter <[email protected]>[...]
Here is the summary with links:
- [net-next] selftests: netfilter: Fix skip of wildcard interface test
https://git.kernel.org/netdev/net-next/c/6da5f1b4b4a0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html