From: Michal Nowak Date: Wed, 8 Oct 2025 18:13:58 +0000 (+0200) Subject: Fix forward ns4 when statistics-channels is disabled X-Git-Tag: v9.21.18~28^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a4355331a0b6f240bf6f1b26fd540af48d33983;p=thirdparty%2Fbind9.git Fix forward ns4 when statistics-channels is disabled With statistics-channels disabled, ns4 fails to start with: option 'statistics-channels' was not enabled at compile time --- diff --git a/bin/tests/system/forward/ns4/named.conf.j2 b/bin/tests/system/forward/ns4/named.conf.j2 index 5a12eef685c..8e3e05136e3 100644 --- a/bin/tests/system/forward/ns4/named.conf.j2 +++ b/bin/tests/system/forward/ns4/named.conf.j2 @@ -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; diff --git a/bin/tests/system/forward/tests.sh b/bin/tests/system/forward/tests.sh index 024e21c3c7c..a1d7ad154d0 100644 --- a/bin/tests/system/forward/tests.sh +++ b/bin/tests/system/forward/tests.sh @@ -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)"