2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

deleting the last NS should always succeed when not at the zone apex;

added explanatory comments
This commit is contained in:
Andreas Gustafsson 1999-11-19 19:06:18 +00:00
parent 42fe494186
commit 6eccd75f1f

View File

@ -9,6 +9,11 @@
# The server defaults to 127.0.0.1. # The server defaults to 127.0.0.1.
# The port defaults to 53. # The port defaults to 53.
# #
# The "Special NS rules" tests will only work correctly if the
# has no NS records to begin with, or alternatively has a
# single NS record pointing at the name "ns1" (relative to
# the zone name).
#
# Installation notes: # Installation notes:
# #
# This program uses the Net::DNS::Resolver module. # This program uses the Net::DNS::Resolver module.
@ -16,7 +21,7 @@
# #
# perl -MCPAN -e "install Net::DNS" # perl -MCPAN -e "install Net::DNS"
# #
# $Id: update_test.pl,v 1.1 1999/11/02 18:59:43 gson Exp $ # $Id: update_test.pl,v 1.2 1999/11/19 19:06:18 gson Exp $
# #
use Getopt::Std; use Getopt::Std;
@ -221,8 +226,11 @@ test("NOERROR", ["pre", nxrrset("c.$zone CNAME")]);
section("Special NS rules"); section("Special NS rules");
# Deleting the last NS record using "Delete an RR from an RRset" # Deleting the last NS record using "Delete an RR from an RRset"
# should fail both at the zone apex and elsewhere. # should fail at the zone apex and work elsewhere. The pseudocode
# in RFC2136 says it should fail everywhere, but this is in conflict
# with the actual text.
# Apex
test("NOERROR", ["update", test("NOERROR", ["update",
rr_add("$zone 300 NS ns1.$zone"), rr_add("$zone 300 NS ns1.$zone"),
rr_add("$zone 300 NS ns2.$zone")]); rr_add("$zone 300 NS ns2.$zone")]);
@ -231,13 +239,16 @@ test("NOERROR", ["update", rr_del("$zone 300 NS ns2.$zone")]);
test("NOERROR", ["pre", test("NOERROR", ["pre",
yxrrset("$zone 300 NS ns2.$zone")]); yxrrset("$zone 300 NS ns2.$zone")]);
# Non-apex
test("NOERROR", ["update", rr_add("n.$zone 300 NS ns1.$zone")]); test("NOERROR", ["update", rr_add("n.$zone 300 NS ns1.$zone")]);
test("NOERROR", ["update", rr_del("n.$zone 300 NS ns1.$zone")]); test("NOERROR", ["update", rr_del("n.$zone 300 NS ns1.$zone")]);
test("NOERROR", ["pre", test("NOERROR", ["pre", nxrrset("n.$zone 300 NS")]);
yxrrset("n.$zone 300 NS ns1.$zone")]);
# Other ways of deleting NS records should work when not at the apex. # Other ways of deleting NS records should also fail at the apex
# and work elsewhere.
# Non-apex
test("NOERROR", ["update", rr_add("n.$zone 300 NS ns1.$zone")]);
test("NOERROR", ["update", rr_del("n.$zone 300 NS")]); test("NOERROR", ["update", rr_del("n.$zone 300 NS")]);
test("NOERROR", ["pre", nxrrset("n.$zone 300 NS")]); test("NOERROR", ["pre", nxrrset("n.$zone 300 NS")]);
@ -246,8 +257,7 @@ test("NOERROR", ["pre", yxrrset("n.$zone 300 NS")]);
test("NOERROR", ["update", rr_del("n.$zone")]); test("NOERROR", ["update", rr_del("n.$zone")]);
test("NOERROR", ["pre", nxrrset("n.$zone 300 NS")]); test("NOERROR", ["pre", nxrrset("n.$zone 300 NS")]);
# ..but they should not work at the apex. # Apex
test("NOERROR", ["update", rr_del("$zone NS")]); test("NOERROR", ["update", rr_del("$zone NS")]);
test("NOERROR", ["pre", test("NOERROR", ["pre",
yxrrset("$zone 300 NS ns2.$zone")]); yxrrset("$zone 300 NS ns2.$zone")]);
@ -338,10 +348,14 @@ test("NOERROR", ["update", rr_add("$zone 300 SOA mname3. . $old_serial " .
($db_soa) = $res->query($zone, "SOA")->answer; ($db_soa) = $res->query($zone, "SOA")->answer;
assert($db_soa->mname eq "mname1"); assert($db_soa->mname eq "mname1");
#
# Currently commented out because Net::DNS does not properly
# support multiple strings in TXT records.
#
#section("Big data"); #section("Big data");
#test("NOERROR", ["update", rr_add("a.$zone 300 TXT aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc")]); #test("NOERROR", ["update", rr_add("a.$zone 300 TXT aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc")]);
#test("NOERROR", ["update", rr_del("a.$zone 300 TXT aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc")]); #test("NOERROR", ["update", rr_del("a.$zone 300 TXT aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc")]);
#test("NOERROR", ["update", rr_add("a.$zone 300 TXT " . ("foo " x 15000))]); test("NOERROR", ["update", rr_add("a.$zone 300 TXT " . ("foo " x 3))]);
section("Updating TTLs only"); section("Updating TTLs only");
@ -360,10 +374,7 @@ test("NOERROR", ["update", rr_add("b.u.$zone 300 A 73.80.65.49")]);
test("NOERROR", ["update", rr_add("u.$zone 300 TXT txt-not-in-nxt")]); test("NOERROR", ["update", rr_add("u.$zone 300 TXT txt-not-in-nxt")]);
test("NOERROR", ["update", rr_add("u.$zone 300 NS ns.u.$zone")]); test("NOERROR", ["update", rr_add("u.$zone 300 NS ns.u.$zone")]);
# Silly protocol won't let us remove the last NS record by value, test("NOERROR", ["update", rr_del("u.$zone 300 NS ns.u.$zone")]);
# but will let us remove it by deleting the entire RRset.
# test("NOERROR", ["update", rr_del("u.$zone 300 NS ns.u.$zone")]);
test("NOERROR", ["update", rr_del("u.$zone 300 NS")]);
if ($failures) { if ($failures) {
print "$failures tests failed.\n"; print "$failures tests failed.\n";