]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
revise soft limit test
authorEvan Hunt <each@isc.org>
Mon, 26 Feb 2018 21:10:44 +0000 (13:10 -0800)
committerMichał Kępień <michal@isc.org>
Thu, 1 Mar 2018 14:40:59 +0000 (15:40 +0100)
- don't bail out of the loop if clients are exceeded, just count incidents
- verbosely describe expectations and results

(cherry picked from commit 86838b2a028146142602348285a6b2f89084df80)

bin/tests/system/fetchlimit/tests.sh

index 724149f66a0e7cf81c9a33c9befb9ab58cb76a15..9ffb23668b04aee9d873dafcb89f859f67604f70 100644 (file)
@@ -165,21 +165,25 @@ $RNDCCMD reconfig 2>&1 | sed 's/^/ns3 /' | cat_i
 echo_i "checking lame server clients are dropped at the soft limit"
 ret=0
 fail=0
+exceeded=0
 success=0
 touch ans4/norespond
 for try in 1 2 3 4 5; do
     burst b $try 400
     $DIG @10.53.0.3 -p ${PORT}  a ${try}.example > dig.out.ns3.$try
-    stat 360 || ret=1
+    stat 360 || exceeded=`expr $exceeded + 1`
     grep "status: NOERROR" dig.out.ns3.$try > /dev/null 2>&1 && \
             success=`expr $success + 1`
     grep "status: SERVFAIL" dig.out.ns3.$try > /dev/null 2>&1 && \
             fail=`expr $fail + 1`
-    [ $ret -eq 1 ] && break
     sleep 1
 done
-echo_i "$success successful valid queries, $fail SERVFAIL"
-[ "$success" -eq 5 ] || ret=1
+echo_i "$success successful valid queries (expected 5)"
+[ "$success" -eq 5 ] || { echo_i "failed"; ret=1; }
+echo_i "$fail SERVFAIL responses (expected 0)"
+[ "$fail" -eq 0 ] || { echo_i "failed"; ret=1; }
+echo_i "clients count exceeded 360 on $exceeded trials (expected 0)"
+[ "$exceeded" -eq 0 ] || { echo_i "failed"; ret=1; }
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`