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.
This commit is contained in:
Aram Sargsyan 2026-04-13 11:42:07 +00:00 committed by Arаm Sаrgsyаn
parent d2f7b969fe
commit 979ae7d9d6
2 changed files with 53 additions and 0 deletions

View file

@ -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 <<END >>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

View file

@ -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",