160160 $DIG $DIGOPTS $z @10.53.0.1 nsec > dig.out.ns1.test$n || ret=1
161161 grep " NS SOA" dig.out.ns1.test$n > /dev/null || ret=1
162162 done
163- for z in bar. example. private.secure.example.
163+ for z in bar. example. private.secure.example. optout-with-ent.
164164 do
165165 $DIG $DIGOPTS $z @10.53.0.2 nsec > dig.out.ns2.test$n || ret=1
166166 grep " NS SOA" dig.out.ns2.test$n > /dev/null || ret=1
@@ -180,6 +180,9 @@ n=$((n + 1))
180180if [ $ret != 0 ]; then echo_i " done" ; fi
181181status=$(( status + ret))
182182
183+ echo_i " Convert optout-with-ent from nsec to nsec3"
184+ ($RNDCCMD 10.53.0.2 signing -nsec3param 1 1 1 - optout-with-ent 2>&1 | sed ' s/^/ns2 /' | cat_i) || ret=1
185+
183186echo_i " Initial counts of RRSIG expiry fields values for auto signed zones"
184187for z in .
185188do
@@ -1566,5 +1569,45 @@ n=$((n + 1))
15661569if [ $ret != 0 ]; then echo_i " failed" ; fi
15671570status=$(( status + ret))
15681571
1572+ echo_i " check removal of ENT NSEC3 records when opt out delegations are removed ($n )"
1573+ ret=0
1574+ zone=optout-with-ent
1575+ hash=JTR8R6AVFULU0DQH9I6HNN2KUK5956EL
1576+ # check that NSEC3 for ENT is present
1577+ $DIG $DIGOPTS @10.53.0.2 a " ent.${zone} " > dig.out.pre.ns2.test$n
1578+ grep " status: NOERROR" dig.out.pre.ns2.test$n > /dev/null || ret=1
1579+ grep " ANSWER: 0, AUTHORITY: 4, " dig.out.pre.ns2.test$n > /dev/null || ret=1
1580+ grep " ^${hash} .${zone} ." dig.out.pre.ns2.test$n > /dev/null || ret=1
1581+ # remove first delegation of two delegations, NSEC3 for ENT should remain.
1582+ (
1583+ echo zone $zone
1584+ echo server 10.53.0.2 " $PORT "
1585+ echo update del sub1.ent.$zone NS
1586+ echo send
1587+ ) | $NSUPDATE
1588+ # check that NSEC3 for ENT is still present
1589+ $DIG $DIGOPTS @10.53.0.2 a " ent.${zone} " > dig.out.pre.ns2.test$n
1590+ $DIG $DIGOPTS @10.53.0.2 a " ent.${zone} " > dig.out.mid.ns2.test$n
1591+ grep " status: NOERROR" dig.out.mid.ns2.test$n > /dev/null || ret=1
1592+ grep " ANSWER: 0, AUTHORITY: 4, " dig.out.mid.ns2.test$n > /dev/null || ret=1
1593+ grep " ^${hash} .${zone} ." dig.out.mid.ns2.test$n > /dev/null || ret=1
1594+ # remove second delegation of two delegations, NSEC3 for ENT should be deleted.
1595+ (
1596+ echo zone $zone
1597+ echo server 10.53.0.2 " $PORT "
1598+ echo update del sub2.ent.$zone NS
1599+ echo send
1600+ ) | $NSUPDATE
1601+ # check that NSEC3 for ENT is gone present
1602+ $DIG $DIGOPTS @10.53.0.2 a " ent.${zone} " > dig.out.post.ns2.test$n
1603+ grep " status: NXDOMAIN" dig.out.post.ns2.test$n > /dev/null || ret=1
1604+ grep " ANSWER: 0, AUTHORITY: 4, " dig.out.post.ns2.test$n > /dev/null || ret=1
1605+ grep " ^${hash} .${zone} ." dig.out.post.ns2.test$n > /dev/null && ret=1
1606+ $DIG $DIGOPTS @10.53.0.2 axfr " ${zone} " > dig.out.axfr.ns2.test$n
1607+ grep " ^${hash} .${zone} ." dig.out.axfr.ns2.test$n > /dev/null && ret=1
1608+ n=$(( n+ 1 ))
1609+ if [ " $ret " -ne 0 ]; then echo_i " failed" ; fi
1610+ status=$(( status+ ret))
1611+
15691612echo_i " exit status: $status "
15701613[ $status -eq 0 ] || exit 1
0 commit comments