Skip to content

Commit c858620

Browse files
Florian Westphalummakynes
authored andcommitted
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 <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 34243b9 commit c858620

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/testing/selftests/netfilter/nft_zones_many.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ns="ns-$sfx"
99
# Kselftest framework requirement - SKIP code is 4.
1010
ksft_skip=4
1111

12-
zones=20000
12+
zones=2000
1313
have_ct_tool=0
1414
ret=0
1515

@@ -75,18 +75,18 @@ EOF
7575

7676
while [ $i -lt $max_zones ]; do
7777
local start=$(date +%s%3N)
78-
i=$((i + 10000))
78+
i=$((i + 1000))
7979
j=$((j + 1))
8080
# 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
8282
if [ $? -ne 0 ] ;then
8383
ret=1
8484
break
8585
fi
8686

8787
stop=$(date +%s%3N)
8888
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)"
9090
done
9191

9292
if [ $have_ct_tool -eq 1 ]; then
@@ -128,11 +128,11 @@ test_conntrack_tool() {
128128
break
129129
fi
130130

131-
if [ $((i%10000)) -eq 0 ];then
131+
if [ $((i%1000)) -eq 0 ];then
132132
stop=$(date +%s%3N)
133133

134134
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)"
136136
start=$stop
137137
fi
138138
done

0 commit comments

Comments
 (0)