]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Wait for TCP connection refused in the statistics system test
authorOndřej Surý <ondrej@isc.org>
Thu, 14 Jul 2022 13:37:32 +0000 (15:37 +0200)
committerEvan Hunt <each@isc.org>
Thu, 14 Jul 2022 20:08:29 +0000 (13:08 -0700)
The statistics system test makes a query to foo.info to check for the
pending connections because the ans4 doesn't respond to the query.

This might or might not (depending on exact timing) increment the failed
TCP connection counter when the query is retried over TCP because ans4
doesn't listen on the TCP.

Wait for the 'connection refused' in the ns3 log file to be able to
count the exactly 1 failed TCP connection.

bin/tests/system/statistics/clean.sh
bin/tests/system/statistics/tests.sh

index da495853953ec281ee45f000e0b877a9a4655dcc..37fa7dc9af142e1dea46945a6075febcfe8815ca 100644 (file)
@@ -29,4 +29,4 @@ rm -f ns*/named.lock
 rm -f stats*out
 rm -f ns*/managed-keys.bind*
 rm -f xsltproc.out.*
-rm -f named.stats.*
+rm -f named.stats.* ns*/named.stats.*
index 02125ae77258b688675ea34c9058dfd957c65a9c..d21b4622b727eaa6d7fbffa7dff5b8ff6e16e50f 100644 (file)
@@ -144,6 +144,8 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 n=`expr $n + 1`
 
+wait_for_log 10 "connection refused" ns3/named.stats
+
 ret=0
 echo_i "checking that zones with slash are properly shown in XML output ($n)"
 if $FEATURETEST --have-libxml2 && [ -x ${CURL} ] ; then
@@ -232,7 +234,7 @@ if $FEATURETEST --have-libxml2 && [ -e stats.xml.out ] && [ -x "${XSLTPROC}" ]
     # Socket statistics (expect no errors)
     grep "<counter name=\"TCP4AcceptFail\">0</counter>" stats.xml.out >/dev/null || ret=1
     grep "<counter name=\"TCP4BindFail\">0</counter>" stats.xml.out >/dev/null || ret=1
-    grep "<counter name=\"TCP4ConnFail\">0</counter>" stats.xml.out >/dev/null || ret=1
+    grep "<counter name=\"TCP4ConnFail\">1</counter>" stats.xml.out >/dev/null || ret=1
     grep "<counter name=\"TCP4OpenFail\">0</counter>" stats.xml.out >/dev/null || ret=1
     grep "<counter name=\"TCP4RecvErr\">0</counter>" stats.xml.out >/dev/null || ret=1
     # grep "<counter name=\"TCP4SendErr\">0</counter>" stats.xml.out >/dev/null || ret=1