From 97e73e4a57afed3dc5d34bca940290fb19d8cfc9 Mon Sep 17 00:00:00 2001 From: Alessio Podda Date: Wed, 17 Jun 2026 13:40:23 +0200 Subject: [PATCH] Add test for query statistics Ensure that no per-zone glue statistic is printed unless zone-statistics is set to full. (cherry picked from commit e1cb775e95ecb8c5081e5eeff933f4b2f68d5c9c) --- bin/tests/system/statistics/tests.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/statistics/tests.sh b/bin/tests/system/statistics/tests.sh index 565808e347..d4fce11399 100644 --- a/bin/tests/system/statistics/tests.sh +++ b/bin/tests/system/statistics/tests.sh @@ -256,22 +256,26 @@ echo_i "Check that 'zone-statistics full;' is processed by 'rndc reconfig' ($n)" ret=0 # off by default rndc_stats ns2 10.53.0.2 || ret=1 -sed -n '/Per Zone Query Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null && ret=0 +sed -n '/Per Zone Query Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null && ret=1 +sed -n '/Per Zone Glue Cache Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null && ret=1 # turn on cp ns2/named2.conf ns2/named.conf rndc_reconfig ns2 10.53.0.2 rndc_stats ns2 10.53.0.2 || ret=1 sed -n '/Per Zone Query Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null || ret=1 +sed -n '/Per Zone Glue Cache Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null || ret=1 # turn off cp ns2/named1.conf ns2/named.conf rndc_reconfig ns2 10.53.0.2 rndc_stats ns2 10.53.0.2 || ret=1 -sed -n '/Per Zone Query Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null && ret=0 +sed -n '/Per Zone Query Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null && ret=1 +sed -n '/Per Zone Glue Cache Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null && ret=1 # turn on cp ns2/named2.conf ns2/named.conf rndc_reconfig ns2 10.53.0.2 rndc_stats ns2 10.53.0.2 || ret=1 sed -n '/Per Zone Query Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null || ret=1 +sed -n '/Per Zone Glue Cache Statistics/,/^++/p' $last_stats | grep -F '[example]' >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) n=$((n + 1))