mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
middleware/file: Support delegations (#124)
Return a delegation when seeing one while traversing the tree in search of an answer. Put the SOA and NS record in the zone.Apex as these are to be handled somewhat special. Lowercase record on insert to make compares easier. This lowercases all RR that have domain names in their rdata as well.
This commit is contained in:
@@ -85,7 +85,7 @@ func TestShouldTransfer(t *testing.T) {
|
||||
z.TransferFrom = []string{addrstr}
|
||||
|
||||
// Serial smaller
|
||||
z.SOA = test.SOA(fmt.Sprintf("%s IN SOA bla. bla. %d 0 0 0 0 ", testZone, soa.serial-1))
|
||||
z.Apex.SOA = test.SOA(fmt.Sprintf("%s IN SOA bla. bla. %d 0 0 0 0 ", testZone, soa.serial-1))
|
||||
should, err := z.shouldTransfer()
|
||||
if err != nil {
|
||||
t.Fatalf("unable to run shouldTransfer: %v", err)
|
||||
@@ -94,7 +94,7 @@ func TestShouldTransfer(t *testing.T) {
|
||||
t.Fatalf("shouldTransfer should return true for serial: %q", soa.serial-1)
|
||||
}
|
||||
// Serial equal
|
||||
z.SOA = test.SOA(fmt.Sprintf("%s IN SOA bla. bla. %d 0 0 0 0 ", testZone, soa.serial))
|
||||
z.Apex.SOA = test.SOA(fmt.Sprintf("%s IN SOA bla. bla. %d 0 0 0 0 ", testZone, soa.serial))
|
||||
should, err = z.shouldTransfer()
|
||||
if err != nil {
|
||||
t.Fatalf("unable to run shouldTransfer: %v", err)
|
||||
@@ -125,7 +125,7 @@ func TestTransferIn(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to run TransferIn: %v", err)
|
||||
}
|
||||
if z.SOA.String() != fmt.Sprintf("%s 3600 IN SOA bla. bla. 250 0 0 0 0", testZone) {
|
||||
if z.Apex.SOA.String() != fmt.Sprintf("%s 3600 IN SOA bla. bla. 250 0 0 0 0", testZone) {
|
||||
t.Fatalf("unknown SOA transferred")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user