Add a catz test with a duplicate primaries entry (alternative syntax)

This new check ads a catalog member zone with both variants of
the labeled primaries/masters property. This should not cause
any issues.

(cherry picked from commit 4f5f4b77c7)
This commit is contained in:
Aram Sargsyan 2026-05-04 11:40:57 +00:00
parent 8242105d5d
commit 7eed9397e2

View file

@ -2993,6 +2993,52 @@ 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))
##########################################################################
nextpart ns2/named.run >/dev/null
echo_i "Testing primaries and masters suboptions together"
n=$((n + 1))
echo_i "adding domain dom22.example. to primary via RNDC ($n)"
ret=0
echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" >ns1/dom22.example.db
echo "@ IN NS invalid." >>ns1/dom22.example.db
echo "@ IN A 192.0.2.1" >>ns1/dom22.example.db
rndccmd 10.53.0.1 addzone dom22.example. in default '{type primary; file "dom22.example.db"; allow-transfer { key tsig_key; };};' || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "adding dom22.example. with both primaries and masters suboptions ($n)"
ret=0
$NSUPDATE -d <<END >>nsupdate.out.test$n 2>&1 || ret=1
server 10.53.0.1 ${PORT}
update add double.zones.catalog1.example. 3600 IN PTR dom22.example.
update add samelabel.primaries.ext.double.zones.catalog1.example. 3600 IN A 10.53.0.1
update add samelabel.primaries.ext.double.zones.catalog1.example. 3600 IN TXT "tsig_key"
update add samelabel.masters.ext.double.zones.catalog1.example. 3600 IN A 10.53.0.1
update add samelabel.masters.ext.double.zones.catalog1.example. 3600 IN TXT "tsig_key"
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 ns2/named.run "catz: adding zone 'dom22.example' from catalog 'catalog1.example'" \
&& wait_for_message ns2/named.run "transfer of 'dom22.example/IN/default' 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 dom22.example. is served by secondary ($n)"
ret=0
wait_for_soa @10.53.0.2 dom22.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