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

selftests: netfilter: reduce zone stress test running time

This selftests needs almost 3 minutes to complete, reduce the
insertes zones to 1000. Test now completes in about 20 seconds.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Florian Westphal and committed by
Pablo Neira Ayuso
c858620d 34243b9e

+6 -6
+6 -6
tools/testing/selftests/netfilter/nft_zones_many.sh
··· 9 9 # Kselftest framework requirement - SKIP code is 4. 10 10 ksft_skip=4 11 11 12 - zones=20000 12 + zones=2000 13 13 have_ct_tool=0 14 14 ret=0 15 15 ··· 75 75 76 76 while [ $i -lt $max_zones ]; do 77 77 local start=$(date +%s%3N) 78 - i=$((i + 10000)) 78 + i=$((i + 1000)) 79 79 j=$((j + 1)) 80 80 # nft rule in output places each packet in a different zone. 81 - dd if=/dev/zero of=/dev/stdout bs=8k count=10000 2>/dev/null | ip netns exec "$ns" socat STDIN UDP:127.0.0.1:12345,sourceport=12345 81 + dd if=/dev/zero of=/dev/stdout bs=8k count=1000 2>/dev/null | ip netns exec "$ns" socat STDIN UDP:127.0.0.1:12345,sourceport=12345 82 82 if [ $? -ne 0 ] ;then 83 83 ret=1 84 84 break ··· 86 86 87 87 stop=$(date +%s%3N) 88 88 local duration=$((stop-start)) 89 - echo "PASS: added 10000 entries in $duration ms (now $i total, loop $j)" 89 + echo "PASS: added 1000 entries in $duration ms (now $i total, loop $j)" 90 90 done 91 91 92 92 if [ $have_ct_tool -eq 1 ]; then ··· 128 128 break 129 129 fi 130 130 131 - if [ $((i%10000)) -eq 0 ];then 131 + if [ $((i%1000)) -eq 0 ];then 132 132 stop=$(date +%s%3N) 133 133 134 134 local duration=$((stop-start)) 135 - echo "PASS: added 10000 entries in $duration ms (now $i total)" 135 + echo "PASS: added 1000 entries in $duration ms (now $i total)" 136 136 start=$stop 137 137 fi 138 138 done