From a46c121db4a50748eae0a32bed786f68349c95f5 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Sat, 23 Nov 2024 19:29:02 +0100 Subject: [PATCH] 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 ];