From: Aram Sargsyan Date: Mon, 13 Apr 2026 11:42:07 +0000 (+0000) Subject: A a test to check zone filename case-insensitivity X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=979ae7d9d6b9ad5fd378f0cbea93461144355fa4;p=thirdparty%2Fbind9.git A a test to check zone filename case-insensitivity The test adds a catalog member zone which has '%X' in its name and it ends up in the zone filename parser's code because the filename is currently generated (by the catalog zone code) based on the zone's name. Zones which have a name with the '%' special character should be filtered and their name's digest should be used instead for filenane generation (like it is implemented for other special characters), and that fix is coming next. --- diff --git a/bin/tests/system/catz/tests.sh b/bin/tests/system/catz/tests.sh index e90b606d82c..46956a8ed94 100644 --- a/bin/tests/system/catz/tests.sh +++ b/bin/tests/system/catz/tests.sh @@ -2973,6 +2973,58 @@ wait_for_soa @10.53.0.2 dom21.example. dig.out.test$n || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status + ret)) +########################################################################## +# GL #5849 + +n=$((n + 1)) +echo_i "Adding a domain token%Xname.example. to primary via RNDC ($n)" +ret=0 +# enough initial content for IXFR response when TXT record is added below +echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" >ns1/tokenXname.example.db +echo "@ 3600 IN NS invalid." >>ns1/tokenXname.example.db +echo "foo 3600 IN TXT some content here" >>ns1/tokenXname.example.db +echo "bar 3600 IN TXT some content here" >>ns1/tokenXname.example.db +echo "xxx 3600 IN TXT some content here" >>ns1/tokenXname.example.db +echo "yyy 3600 IN TXT some content here" >>ns1/tokenXname.example.db +rndccmd 10.53.0.1 addzone token%Xname.example. in default '{ type primary; file "tokenXname.example.db"; allow-transfer { any; }; allow-update { any; }; notify explicit; also-notify { 10.53.0.4; }; };' || ret=1 +if [ $ret -ne 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + +n=$((n + 1)) +echo_i "checking that token%Xname.example. is now served by primary ($n)" +ret=0 +wait_for_soa @10.53.0.1 token%Xname.example. dig.out.test$n || ret=1 +if [ $ret -ne 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + +nextpart ns4/named.run >/dev/null + +n=$((n + 1)) +echo_i "Adding domain token%Xname.example. to catalog-misc zone ($n)" +ret=0 +$NSUPDATE -d <>nsupdate.out.test$n 2>&1 || ret=1 + server 10.53.0.1 ${PORT} + update add tokenXname.zones.catalog-misc.example. 3600 IN PTR token%Xname.example. + send +END +if [ $ret -ne 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + +n=$((n + 1)) +echo_i "waiting for secondary to sync up ($n)" +ret=0 +wait_for_message ns4/named.run "catz: adding zone 'token%Xname.example' from catalog 'catalog-misc.example'" \ + && wait_for_message ns4/named.run "transfer of 'token%Xname.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" || ret=1 +if [ $ret -ne 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + +n=$((n + 1)) +echo_i "checking that token%Xname.example. is served by secondary ($n)" +ret=0 +wait_for_soa @10.53.0.4 token%Xname.example. dig.out.test$n || ret=1 +if [ $ret -ne 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + ########################################################################## echo_i "exit status: $status" [ $status -eq 0 ] || exit 1 diff --git a/bin/tests/system/catz/tests_sh_catz.py b/bin/tests/system/catz/tests_sh_catz.py index 4b68e2f65e5..339a8ed8dc1 100644 --- a/bin/tests/system/catz/tests_sh_catz.py +++ b/bin/tests/system/catz/tests_sh_catz.py @@ -23,6 +23,7 @@ pytestmark = pytest.mark.extra_artifacts( "ns*/*dom*.example.db", "ns1/check-allow-query.example.db", "ns1/longlong.longlong.long.long.name.example.db", + "ns1/tokenXname.example.db", "ns1/tls1.example.db", "ns2/__catz__*.db", "ns2/named.conf.tmp",