]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix forward ns4 when statistics-channels is disabled
authorMichal Nowak <mnowak@isc.org>
Wed, 8 Oct 2025 18:13:58 +0000 (20:13 +0200)
committerMichal Nowak <mnowak@isc.org>
Thu, 15 Jan 2026 13:30:37 +0000 (14:30 +0100)
With statistics-channels disabled, ns4 fails to start with:

    option 'statistics-channels' was not enabled at compile time

bin/tests/system/forward/ns4/named.conf.j2
bin/tests/system/forward/tests.sh

index 5a12eef685c653b659a391fdfe4480e5f50990e8..8e3e05136e3a568ad7c2f69f82074d4b99b812e8 100644 (file)
@@ -33,7 +33,9 @@ options {
 
 };
 
+{% if FEATURE_JSON_C == "1" %}
 statistics-channels { inet 10.53.0.4 port @EXTRAPORT1@ allow { localhost; }; };
+{% endif %}
 
 zone "." {
        type hint;
index 024e21c3c7cbf2ee5fc96791eddc7277b1107e4b..a1d7ad154d021435a353f8902909055e83d9962e 100644 (file)
@@ -170,12 +170,16 @@ status=$((status + ret))
 # GL#1793
 n=$((n + 1))
 echo_i "checking that the correct counter is 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
-grep -F '"ForwardOnlyFail":1' statschannel.out.$n >/dev/null || ret=1
-if [ $ret != 0 ]; then echo_i "failed"; fi
-status=$((status + ret))
+if $FEATURETEST --have-json-c && [ -x ${CURL} ]; then
+  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
+  grep -F '"ForwardOnlyFail":1' statschannel.out.$n >/dev/null || ret=1
+  if [ $ret != 0 ]; then echo_i "failed"; fi
+  status=$((status + ret))
+else
+  echo_i "skipping test as libjson-c and/or curl was not found"
+fi
 
 n=$((n + 1))
 echo_i "checking for negative caching of forwarder response ($n)"