Wait for TCP connection refused in the statistics system test

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.
This commit is contained in:
Ondřej Surý
2022-07-14 15:37:32 +02:00
committed by Evan Hunt
parent 6b15eb45df
commit d1433da524
2 changed files with 4 additions and 2 deletions

View 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.*

View 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