]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a statistics channel check in the forward system test
authorAram Sargsyan <aram@isc.org>
Thu, 12 Sep 2024 12:17:28 +0000 (12:17 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 16 Sep 2024 08:23:12 +0000 (08:23 +0000)
Check that the fix in the previous commit works and that the
'ServerQuota' counter in the statistics channel is still unset
after a SERVFAIL result in a 'forward only' zone.

bin/tests/system/forward/clean.sh
bin/tests/system/forward/ns4/named.conf.in
bin/tests/system/forward/tests.sh

index c1b4ecd8649329a5f3b5adbce7e0119f554d0840..bf9cc7b57708699b47aceb12ef1909ed89d1b129 100644 (file)
@@ -19,6 +19,7 @@ rm -f ./*/named.memstats
 rm -f ./*/named.run ./*/named.run.prev ./*/ans.run
 rm -f ./*/named_dump.db
 rm -f ./ans*/query.log
+rm -f ./statschannel.out.*
 rm -f ./dig.out.*
 rm -f ./ns*/managed-keys.bind*
 rm -f ./ns*/trusted.conf
index e8d3bbb8a5cf0aae427b30e780a21ce72ac63eaa..5777c0de5168880d0810856e4ff87f5c36541fa2 100644 (file)
@@ -29,6 +29,8 @@ options {
 
 trust-anchors { };
 
+statistics-channels { inet 10.53.0.4 port @EXTRAPORT1@ allow { localhost; }; };
+
 zone "." {
        type hint;
        file "root.db";
index 2705db9a70770384f76bce45204ba1cfe2aacc8b..7a31febb25dd2ff46c4ff7bf82c9341f2b5821d0 100644 (file)
@@ -164,6 +164,15 @@ grep "SERVFAIL" dig.out.$n.f2 >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+# GL#1793
+n=$((n + 1))
+echo_i "checking that the 'serverquota' counter isn't increased because of the SERVFAIL in the previous check ($n)"
+ret=0
+"${CURL}" "http://10.53.0.4:${EXTRAPORT1}/json/v1" 2>/dev/null >statschannel.out.$n
+grep -F "ServerQuota" statschannel.out.$n >/dev/null && ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 n=$((n + 1))
 echo_i "checking for negative caching of forwarder response ($n)"
 # prime the cache, shutdown the forwarder then check that we can