From 1c0ef5fabe836d1dd0f9b3ba443264c6a6390dc5 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 28 Feb 2023 14:10:56 +1100 Subject: [PATCH 1/2] Fix 'lame server clients are dropped below the hard limit' test The test was setting a minimum count for recursive clients which was not always being met (e.g. 91 instead of 100) producing a false positive. Lower the lower bound on recursive clients for this test to 1. (cherry picked from commit af47090d99d68f23107a65cbddea5d0231269484) --- bin/tests/system/fetchlimit/tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tests/system/fetchlimit/tests.sh b/bin/tests/system/fetchlimit/tests.sh index c10bee6677..d34a817ad3 100644 --- a/bin/tests/system/fetchlimit/tests.sh +++ b/bin/tests/system/fetchlimit/tests.sh @@ -167,7 +167,7 @@ touch ans4/norespond for try in 1 2 3 4 5; do burst b $try 400 $DIGCMD +time=2 a ${try}.example > dig.out.ns3.$try - stat 100 400 || exceeded=$((exceeded + 1)) + stat 1 400 || exceeded=$((exceeded + 1)) grep "status: NOERROR" dig.out.ns3.$try > /dev/null 2>&1 && \ success=$((success+1)) grep "status: SERVFAIL" dig.out.ns3.$try > /dev/null 2>&1 && \ From aa8bcc0a5a7cc31ea3527fe276ec1b1052f3af78 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 28 Feb 2023 14:24:20 +1100 Subject: [PATCH 2/2] Fix 'checking drop statistics' test Wait for the desired log message to appear in ns3/named.stats rather than the creation of the file. (cherry picked from commit c7ae975ecf70fb6fc7c836f39b7f1ab4f2fe0129) --- bin/tests/system/fetchlimit/clean.sh | 4 ++-- bin/tests/system/fetchlimit/tests.sh | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/tests/system/fetchlimit/clean.sh b/bin/tests/system/fetchlimit/clean.sh index f0158b1710..935d91bba8 100644 --- a/bin/tests/system/fetchlimit/clean.sh +++ b/bin/tests/system/fetchlimit/clean.sh @@ -12,8 +12,8 @@ # information regarding copyright ownership. rm -f */named.conf */named.memstats */ans.run */named.recursing */named.run -rm -f dig.out* rm -f ans4/norespond -rm -f ns3/named.stats ns3/named_dump.db rm -f burst.input.* +rm -f dig.out* rm -f ns*/managed-keys.bind* +rm -f ns3/named.stats ns3/named.stats.prev ns3/named_dump.db diff --git a/bin/tests/system/fetchlimit/tests.sh b/bin/tests/system/fetchlimit/tests.sh index d34a817ad3..d94539290b 100644 --- a/bin/tests/system/fetchlimit/tests.sh +++ b/bin/tests/system/fetchlimit/tests.sh @@ -185,11 +185,9 @@ status=$((status+ret)) echo_i "checking drop statistics" rm -f ns3/named.stats +touch ns3/named.stats $RNDCCMD stats -for try in 1 2 3 4 5; do - [ -f ns3/named.stats ] && break - sleep 1 -done +wait_for_log 5 "queries dropped due to recursive client limit" ns3/named.stats || ret=1 drops=`grep 'queries dropped due to recursive client limit' ns3/named.stats | sed 's/\([0-9][0-9]*\) queries.*/\1/'` [ "${drops:-0}" -ne 0 ] || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi