Skip to content

Commit 6da5f1b

Browse files
Phil SutterPaolo Abeni
authored andcommitted
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. Fixes: 73db1b5 ("selftests: netfilter: Torture nftables netdev hooks") Signed-off-by: Phil Sutter <[email protected]> Acked-by: Pablo Neira Ayuso <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 290e5d3 commit 6da5f1b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/testing/selftests/net/netfilter/nft_interface_stress.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,18 @@ kill $nft_monitor_pid
9797
kill $rename_loop_pid
9898
wait
9999

100-
ip netns exec $nsr nft -f - <<EOF
100+
wildcard_prep() {
101+
ip netns exec $nsr nft -f - <<EOF
101102
table ip t {
102103
flowtable ft_wild {
103104
hook ingress priority 0
104105
devices = { wild* }
105106
}
106107
}
107108
EOF
108-
if [[ $? -ne 0 ]]; then
109+
}
110+
111+
if ! wildcard_prep; then
109112
echo "SKIP wildcard tests: not supported by host's nft?"
110113
else
111114
for ((i = 0; i < 100; i++)); do

0 commit comments

Comments
 (0)