plugin/file: rework outgoing axfr (#3227)

* plugin/file: rework outgoing axfr

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix test

Signed-off-by: Miek Gieben <miek@miek.nl>

* Actually properly test xfr

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix test

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2019-08-30 13:47:27 +01:00
committed by GitHub
parent b8a0b52a5e
commit 94930d20ea
5 changed files with 70 additions and 54 deletions

View File

@@ -30,12 +30,12 @@ func TestWatcher(t *testing.T) {
a.Walk()
// example.org and example.com should exist
if x := len(a.Zones.Z["example.org."].All()); x != 4 {
t.Fatalf("Expected 4 RRs, got %d", x)
// example.org and example.com should exist, we have 3 apex rrs and 1 "real" record. All() returns the non-apex ones.
if x := len(a.Zones.Z["example.org."].All()); x != 1 {
t.Fatalf("Expected 1 RRs, got %d", x)
}
if x := len(a.Zones.Z["example.com."].All()); x != 4 {
t.Fatalf("Expected 4 RRs, got %d", x)
if x := len(a.Zones.Z["example.com."].All()); x != 1 {
t.Fatalf("Expected 1 RRs, got %d", x)
}
// Now remove one file, rescan and see if it's gone.