git: a46c121db4a5 - main - netpfil tests: make dummynet tests more robust

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Sun, 24 Nov 2024 08:34:31 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=a46c121db4a50748eae0a32bed786f68349c95f5

commit a46c121db4a50748eae0a32bed786f68349c95f5
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-11-23 18:29:02 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-11-24 08:34:09 +0000

    netpfil tests: make dummynet tests more robust
    
    These tests try to verify that packet prioritisation works as expected. This is
    inherently a statistical process, and is difficuly to measure automatically.
    Run the tests more times and accept more failures.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 tests/sys/netpfil/common/dummynet.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh
index 126240f00384..b77b2df84010 100644
--- a/tests/sys/netpfil/common/dummynet.sh
+++ b/tests/sys/netpfil/common/dummynet.sh
@@ -320,7 +320,7 @@ queue_body()
 
 	# TCP should still just pass
 	fails=0
-	for i in `seq 1 3`
+	for i in `seq 1 5`
 	do
 		result=$(dd if=/dev/zero bs=1024 count=2000 | timeout 3 nc -w 5 -N 192.0.2.2 7 | wc -c)
 		if [ $result -ne 2048000 ];
@@ -329,7 +329,7 @@ queue_body()
 			fails=$(( ${fails} + 1 ))
 		fi
 	done
-	if [ ${fails} -gt 0 ];
+	if [ ${fails} -gt 2 ];
 	then
 		atf_fail "We failed prioritisation ${fails} times"
 	fi
@@ -348,7 +348,7 @@ queue_body()
 	sleep 1
 
 	fails=0
-	for i in `seq 1 3`
+	for i in `seq 1 5`
 	do
 		result=$(dd if=/dev/zero bs=1024 count=2000 | timeout 3 nc -w 5 -N 192.0.2.2 7 | wc -c)
 		if [ $result -ne 2048000 ];
@@ -429,7 +429,7 @@ queue_v6_body()
 
 	# TCP should still just pass
 	fails=0
-	for i in `seq 1 3`
+	for i in `seq 1 5`
 	do
 		result=$(dd if=/dev/zero bs=1024 count=1000 | timeout 3 nc -w 5 -N 2001:db8:42::2 7 | wc -c)
 		if [ $result -ne 1024000 ];
@@ -438,7 +438,7 @@ queue_v6_body()
 			fails=$(( ${fails} + 1 ))
 		fi
 	done
-	if [ ${fails} -gt 0 ];
+	if [ ${fails} -gt 2 ];
 	then
 		atf_fail "We failed prioritisation ${fails} times"
 	fi
@@ -454,7 +454,7 @@ queue_v6_body()
 			"pass in proto icmp6 dnqueue (0, 100)"
 
 	fails=0
-	for i in `seq 1 3`
+	for i in `seq 1 5`
 	do
 		result=$(dd if=/dev/zero bs=1024 count=1000 | timeout 3 nc -w 5 -N 2001:db8:42::2 7 | wc -c)
 		if [ $result -ne 1024000 ];