Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: netfilter: fix transaction test script timeout handling

The kselftest framework uses a default timeout of 45 seconds for
all test scripts.

Increase the timeout to two minutes for the netfilter tests, this
should hopefully be enough,

Make sure that, should the script be canceled, the net namespace and
the spawned ping instances are removed.

Fixes: 25d8bcedbf43 ("selftests: add script to stress-test nft packet path vs. control plane")
Reported-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Signed-off-by: Florian Westphal <fw@strlen.de>
Tested-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Florian Westphal and committed by
Pablo Neira Ayuso
c273289f 8fed7565

+10 -7
+9 -7
tools/testing/selftests/netfilter/nft_trans_stress.sh
··· 10 10 ksft_skip=4 11 11 12 12 testns=testns-$(mktemp -u "XXXXXXXX") 13 + tmp="" 13 14 14 15 tables="foo bar baz quux" 15 16 global_ret=0 16 17 eret=0 17 18 lret=0 19 + 20 + cleanup() { 21 + ip netns pids "$testns" | xargs kill 2>/dev/null 22 + ip netns del "$testns" 23 + 24 + rm -f "$tmp" 25 + } 18 26 19 27 check_result() 20 28 { ··· 51 43 exit $ksft_skip 52 44 fi 53 45 46 + trap cleanup EXIT 54 47 tmp=$(mktemp) 55 48 56 49 for table in $tables; do ··· 147 138 done 148 139 149 140 check_result $lret "add/delete with nftrace enabled" 150 - 151 - pkill -9 ping 152 - 153 - wait 154 - 155 - rm -f "$tmp" 156 - ip netns del "$testns" 157 141 158 142 exit $global_ret
+1
tools/testing/selftests/netfilter/settings
··· 1 + timeout=120