status=$((status+ret))
##########################################################################
-echo_i "Testing having a regular zone and a zone in catalog zone of the same name"
+echo_i "Testing recreation of a manually deleted zone after a reload"
n=$((n+1))
-echo_i "checking that dom14.example. is not served by primary ($n)"
+echo_i "checking that dom16.example. is not served by primary ($n)"
ret=0
-wait_for_no_soa @10.53.0.1 dom14.example. dig.out.test$n || ret=1
+wait_for_no_soa @10.53.0.1 dom16.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "Adding a domain dom14.example. to primary ns1 via RNDC ($n)"
+echo_i "Adding a domain dom16.example. to primary ns1 via RNDC ($n)"
ret=0
-echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" > ns1/dom14.example.db
-echo "@ IN NS invalid." >> ns1/dom14.example.db
-echo "@ IN A 192.0.2.1" >> ns1/dom14.example.db
-rndccmd 10.53.0.1 addzone dom14.example. in default '{type primary; file "dom14.example.db";};' || ret=1
+echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" > ns1/dom16.example.db
+echo "@ IN NS invalid." >> ns1/dom16.example.db
+echo "@ IN A 192.0.2.1" >> ns1/dom16.example.db
+rndccmd 10.53.0.1 addzone dom16.example. in default '{type primary; file "dom16.example.db";};' || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "checking that dom14.example. is now served by primary ns1 ($n)"
+echo_i "checking that dom16.example. is now served by primary ns1 ($n)"
ret=0
-wait_for_soa @10.53.0.1 dom14.example. dig.out.test$n || ret=1
+wait_for_soa @10.53.0.1 dom16.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
+
n=$((n+1))
-echo_i "Adding a domain dom14.example. to primary ns3 via RNDC ($n)"
+echo_i "Adding domain dom16.example. to catalog1 zone with ns1 as primary ($n)"
ret=0
-echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" > ns3/dom14.example.db
-echo "@ IN NS invalid." >> ns3/dom14.example.db
-echo "@ IN A 192.0.2.2" >> ns3/dom14.example.db
-rndccmd 10.53.0.3 addzone dom14.example. '{type primary; file "dom14.example.db";};' || ret=1
+$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
+ server 10.53.0.1 ${PORT}
+ update add efe725d0cf430ffb113b9bcf59266f066a21216b.zones.catalog1.example. 3600 IN PTR dom16.example.
+ update add masters.efe725d0cf430ffb113b9bcf59266f066a21216b.zones.catalog1.example. 3600 IN A 10.53.0.1
+ send
+END
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "checking that dom14.example. is now served by primary ns3 ($n)"
+echo_i "waiting for secondary to sync up ($n)"
ret=0
-wait_for_soa @10.53.0.3 dom14.example. dig.out.test$n || ret=1
+wait_for_message ns2/named.run "catz: adding zone 'dom16.example' from catalog 'catalog1.example'" &&
+wait_for_message ns2/named.run "transfer of 'dom16.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))
nextpart ns2/named.run >/dev/null
n=$((n+1))
-echo_i "Adding domain dom14.example. with rndc with ns1 as primary ($n)"
+echo_i "checking that dom16.example. is served by secondary and that it's the one from ns1 ($n)"
ret=0
-rndccmd 10.53.0.2 addzone dom14.example. in default '{type secondary; primaries {10.53.0.1;};};' || ret=1
+wait_for_a @10.53.0.2 dom16.example. dig.out.test$n || ret=1
+grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
-n=$((n+1))
-echo_i "waiting for secondary to sync up ($n)"
+nextpart ns2/named.run >/dev/null
+
+echo_i "Deleting dom16.example. from secondary ns2 via RNDC ($n)"
ret=0
-wait_for_message ns2/named.run "transfer of 'dom14.example/IN/default' from 10.53.0.1#${PORT}: Transfer status: success" || ret=1
+rndccmd 10.53.0.2 delzone dom16.example. in default >/dev/null 2>&1 || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
-nextpart ns2/named.run >/dev/null
-
n=$((n+1))
-echo_i "checking that dom14.example. is served by secondary and that it's the one from ns1 ($n)"
+echo_i "checking that dom16.example. is no longer served by secondary ($n)"
ret=0
-wait_for_a @10.53.0.2 dom14.example. dig.out.test$n || ret=1
-grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
+wait_for_no_soa @10.53.0.2 dom16.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
-n=$((n+1))
-echo_i "Adding domain dom14.example. to catalog2 zone with ns3 as primary ($n)"
+nextpart ns2/named.run >/dev/null
+
+echo_i "Reloading secondary ns2 via RNDC ($n)"
ret=0
-$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.3 ${PORT}
- update add 45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example. 3600 IN PTR dom14.example.
- update add primaries.45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example. 3600 IN A 10.53.0.3
- send
-END
+rndccmd 10.53.0.2 reload >/dev/null 2>&1 || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
status=$((status+ret))
n=$((n+1))
-echo_i "checking that dom14.example. is served by secondary and that it's still the one from ns1 ($n)"
+echo_i "checking that dom16.example. is served by secondary and that it's the one from ns1 ($n)"
ret=0
-wait_for_a @10.53.0.2 dom14.example. dig.out.test$n || ret=1
+wait_for_a @10.53.0.2 dom16.example. dig.out.test$n || ret=1
grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
nextpart ns2/named.run >/dev/null
n=$((n+1))
-echo_i "Deleting domain dom14.example. from catalog2 ($n)"
+echo_i "Deleting domain dom16.example. from catalog1 ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.3 ${PORT}
- update delete 45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example. 3600 IN PTR dom14.example.
- update delete primaries.45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example. 3600 IN A 10.53.0.3
+ server 10.53.0.1 ${PORT}
+ update delete efe725d0cf430ffb113b9bcf59266f066a21216b.zones.catalog1.example. 3600 IN PTR dom16.example.
+ update delete masters.efe725d0cf430ffb113b9bcf59266f066a21216b.zones.catalog1.example. 3600 IN A 10.53.0.1
send
END
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "checking that dom14.example. is served by secondary and that it's still the one from ns1 ($n)"
+echo_i "checking that dom16.example. is no longer served by secondary ($n)"
ret=0
-wait_for_a @10.53.0.2 dom14.example. dig.out.test$n || ret=1
-grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
+wait_for_no_soa @10.53.0.2 dom16.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
##########################################################################
-echo_i "Testing changing label for a member zone"
+echo_i "Testing having a regular zone and a zone in catalog zone of the same name"
n=$((n+1))
-echo_i "checking that dom15.example. is not served by primary ($n)"
+echo_i "checking that dom14.example. is not served by primary ($n)"
ret=0
-wait_for_no_soa @10.53.0.1 dom15.example. dig.out.test$n || ret=1
+wait_for_no_soa @10.53.0.1 dom14.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "Adding a domain dom15.example. to primary ns1 via RNDC ($n)"
+echo_i "Adding a domain dom14.example. to primary ns1 via RNDC ($n)"
ret=0
-echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" > ns1/dom15.example.db
-echo "@ IN NS invalid." >> ns1/dom15.example.db
-rndccmd 10.53.0.1 addzone dom15.example. in default '{type primary; file "dom15.example.db";};' || ret=1
+echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" > ns1/dom14.example.db
+echo "@ IN NS invalid." >> ns1/dom14.example.db
+echo "@ IN A 192.0.2.1" >> ns1/dom14.example.db
+rndccmd 10.53.0.1 addzone dom14.example. in default '{type primary; file "dom14.example.db";};' || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "checking that dom15.example. is now served by primary ns1 ($n)"
-ret=0
-wait_for_soa @10.53.0.1 dom15.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 "Adding domain dom15.example. to catalog1 zone with 'dom15label1' label ($n)"
+echo_i "checking that dom14.example. is now served by primary ns1 ($n)"
ret=0
-$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${PORT}
- update add dom15label1.zones.catalog1.example. 3600 IN PTR dom15.example.
- send
-END
+wait_for_soa @10.53.0.1 dom14.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "waiting for secondary to sync up ($n)"
+echo_i "Adding a domain dom14.example. to primary ns3 via RNDC ($n)"
ret=0
-wait_for_message ns2/named.run "catz: update_from_db: new zone merged" || ret=1
+echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" > ns3/dom14.example.db
+echo "@ IN NS invalid." >> ns3/dom14.example.db
+echo "@ IN A 192.0.2.2" >> ns3/dom14.example.db
+rndccmd 10.53.0.3 addzone dom14.example. '{type primary; file "dom14.example.db";};' || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
-sleep 3
-
n=$((n+1))
-echo_i "checking that dom15.example. is served by secondary ($n)"
+echo_i "checking that dom14.example. is now served by primary ns3 ($n)"
ret=0
-wait_for_soa @10.53.0.2 dom15.example. dig.out.test$n || ret=1
+wait_for_soa @10.53.0.3 dom14.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
n=$((n+1))
-echo_i "Changing label of domain dom15.example. from 'dom15label1' to 'dom15label2' ($n)"
+echo_i "Adding domain dom14.example. with rndc with ns1 as primary ($n)"
ret=0
-$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${PORT}
- update delete dom15label1.zones.catalog1.example. 3600 IN PTR dom15.example.
- update add dom15label2.zones.catalog1.example. 3600 IN PTR dom15.example.
- send
-END
+rndccmd 10.53.0.2 addzone dom14.example. in default '{type secondary; primaries {10.53.0.1;};};' || ret=1
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: update_from_db: new zone merged" || ret=1
+wait_for_message ns2/named.run "transfer of 'dom14.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))
+nextpart ns2/named.run >/dev/null
+
n=$((n+1))
-echo_i "checking that dom15.example. is served by secondary ($n)"
+echo_i "checking that dom14.example. is served by secondary and that it's the one from ns1 ($n)"
ret=0
-wait_for_soa @10.53.0.2 dom15.example. dig.out.test$n || ret=1
+wait_for_a @10.53.0.2 dom14.example. dig.out.test$n || ret=1
+grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
-##########################################################################
-echo_i "Testing recreation of a manually deleted zone after a reload"
n=$((n+1))
-echo_i "checking that dom16.example. is not served by primary ($n)"
+echo_i "Adding domain dom14.example. to catalog2 zone with ns3 as primary ($n)"
ret=0
-wait_for_no_soa @10.53.0.1 dom16.example. dig.out.test$n || ret=1
+$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
+ server 10.53.0.3 ${PORT}
+ update add 45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example. 3600 IN PTR dom14.example.
+ update add primaries.45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example. 3600 IN A 10.53.0.3
+ send
+END
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "Adding a domain dom16.example. to primary ns1 via RNDC ($n)"
+echo_i "waiting for secondary to sync up ($n)"
ret=0
-echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" > ns1/dom16.example.db
-echo "@ IN NS invalid." >> ns1/dom16.example.db
-echo "@ IN A 192.0.2.1" >> ns1/dom16.example.db
-rndccmd 10.53.0.1 addzone dom16.example. in default '{type primary; file "dom16.example.db";};' || ret=1
+wait_for_message ns2/named.run "catz: update_from_db: new zone merged" || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "checking that dom16.example. is now served by primary ns1 ($n)"
+echo_i "checking that dom14.example. is served by secondary and that it's still the one from ns1 ($n)"
ret=0
-wait_for_soa @10.53.0.1 dom16.example. dig.out.test$n || ret=1
+wait_for_a @10.53.0.2 dom14.example. dig.out.test$n || ret=1
+grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
nextpart ns2/named.run >/dev/null
n=$((n+1))
-echo_i "Adding domain dom16.example. to catalog1 zone with ns1 as primary ($n)"
+echo_i "Deleting domain dom14.example. from catalog2 ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${PORT}
- update add efe725d0cf430ffb113b9bcf59266f066a21216b.zones.catalog1.example. 3600 IN PTR dom16.example.
- update add masters.efe725d0cf430ffb113b9bcf59266f066a21216b.zones.catalog1.example. 3600 IN A 10.53.0.1
+ server 10.53.0.3 ${PORT}
+ update delete 45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example. 3600 IN PTR dom14.example.
+ update delete primaries.45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example. 3600 IN A 10.53.0.3
send
END
if [ $ret -ne 0 ]; then echo_i "failed"; fi
n=$((n+1))
echo_i "waiting for secondary to sync up ($n)"
ret=0
-wait_for_message ns2/named.run "catz: adding zone 'dom16.example' from catalog 'catalog1.example'" &&
-wait_for_message ns2/named.run "transfer of 'dom16.example/IN/default' from 10.53.0.1#${PORT}: Transfer status: success" || ret=1
+wait_for_message ns2/named.run "catz: update_from_db: new zone merged" || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
-nextpart ns2/named.run >/dev/null
-
n=$((n+1))
-echo_i "checking that dom16.example. is served by secondary and that it's the one from ns1 ($n)"
+echo_i "checking that dom14.example. is served by secondary and that it's still the one from ns1 ($n)"
ret=0
-wait_for_a @10.53.0.2 dom16.example. dig.out.test$n || ret=1
+wait_for_a @10.53.0.2 dom14.example. dig.out.test$n || ret=1
grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
-nextpart ns2/named.run >/dev/null
+##########################################################################
+echo_i "Testing changing label for a member zone"
+n=$((n+1))
+echo_i "checking that dom15.example. is not served by primary ($n)"
+ret=0
+wait_for_no_soa @10.53.0.1 dom15.example. dig.out.test$n || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status+ret))
-echo_i "Deleting dom16.example. from secondary ns2 via RNDC ($n)"
+n=$((n+1))
+echo_i "Adding a domain dom15.example. to primary ns1 via RNDC ($n)"
ret=0
-rndccmd 10.53.0.2 delzone dom16.example. in default >/dev/null 2>&1 || ret=1
+echo "@ 3600 IN SOA . . 1 3600 3600 3600 3600" > ns1/dom15.example.db
+echo "@ IN NS invalid." >> ns1/dom15.example.db
+rndccmd 10.53.0.1 addzone dom15.example. in default '{type primary; file "dom15.example.db";};' || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "checking that dom16.example. is no longer served by secondary ($n)"
+echo_i "checking that dom15.example. is now served by primary ns1 ($n)"
ret=0
-wait_for_no_soa @10.53.0.2 dom16.example. dig.out.test$n || ret=1
+wait_for_soa @10.53.0.1 dom15.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 "Reloading secondary ns2 via RNDC ($n)"
+echo_i "Adding domain dom15.example. to catalog1 zone with 'dom15label1' label ($n)"
ret=0
-rndccmd 10.53.0.2 reload >/dev/null 2>&1 || ret=1
+$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
+ server 10.53.0.1 ${PORT}
+ update add dom15label1.zones.catalog1.example. 3600 IN PTR dom15.example.
+ send
+END
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
+sleep 3
+
n=$((n+1))
-echo_i "checking that dom16.example. is served by secondary and that it's the one from ns1 ($n)"
+echo_i "checking that dom15.example. is served by secondary ($n)"
ret=0
-wait_for_a @10.53.0.2 dom16.example. dig.out.test$n || ret=1
-grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
+wait_for_soa @10.53.0.2 dom15.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
n=$((n+1))
-echo_i "Deleting domain dom16.example. from catalog1 ($n)"
+echo_i "Changing label of domain dom15.example. from 'dom15label1' to 'dom15label2' ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
server 10.53.0.1 ${PORT}
- update delete efe725d0cf430ffb113b9bcf59266f066a21216b.zones.catalog1.example. 3600 IN PTR dom16.example.
- update delete masters.efe725d0cf430ffb113b9bcf59266f066a21216b.zones.catalog1.example. 3600 IN A 10.53.0.1
+ update delete dom15label1.zones.catalog1.example. 3600 IN PTR dom15.example.
+ update add dom15label2.zones.catalog1.example. 3600 IN PTR dom15.example.
send
END
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
-echo_i "checking that dom16.example. is no longer served by secondary ($n)"
+echo_i "checking that dom15.example. is served by secondary ($n)"
ret=0
-wait_for_no_soa @10.53.0.2 dom16.example. dig.out.test$n || ret=1
+wait_for_soa @10.53.0.2 dom15.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))