Skip to content

Commit 90ab512

Browse files
Boris Sukholitkoummakynes
authored andcommitted
selftests: nft_flowtable.sh: monitor result file sizes
When running nft_flowtable.sh in VM on a busy server we've found that the time of the netcat file transfers vary wildly. Therefore replace hardcoded 3 second sleep with the loop checking for a change in the file sizes. Once no change in detected we test the results. Nice side effect is that we shave 1 second sleep in the fast case (hard-coded 3 second sleep vs two 1 second sleeps). Acked-by: Florian Westphal <[email protected]> Signed-off-by: Boris Sukholitko <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 1114803 commit 90ab512

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/testing/selftests/netfilter/nft_flowtable.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,15 @@ test_tcp_forwarding_ip()
286286
ip netns exec $nsa nc -w 4 "$dstip" "$dstport" < "$nsin" > "$ns1out" &
287287
cpid=$!
288288

289-
sleep 3
289+
sleep 1
290+
291+
prev="$(ls -l $ns1out $ns2out)"
292+
sleep 1
293+
294+
while [[ "$prev" != "$(ls -l $ns1out $ns2out)" ]]; do
295+
sleep 1;
296+
prev="$(ls -l $ns1out $ns2out)"
297+
done
290298

291299
if test -d /proc/"$lpid"/; then
292300
kill $lpid

0 commit comments

Comments
 (0)