middleware/file: fix delegations (#376)

Fix the delegation handling in the *file* and *dnssec* middleware.
Refactor tests a bit and show that they are failling.

Add a Tree printer, cleanups and tests.
Fix wildcard test - should get no answer from empty-non-terminal
This commit is contained in:
Miek Gieben
2016-11-05 14:39:49 +00:00
committed by GitHub
parent d6902cd7a1
commit 2cca527d9f
18 changed files with 658 additions and 624 deletions

View File

@@ -40,7 +40,7 @@ func TestLookupWildcard(t *testing.T) {
p := proxy.New([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
for _, lookup := range []string{"w.example.org.", "a.w.example.org.", "a.a.w.example.org."} {
for _, lookup := range []string{"a.w.example.org.", "a.a.w.example.org."} {
resp, err := p.Lookup(state, lookup, dns.TypeTXT)
if err != nil || resp == nil {
t.Fatalf("Expected to receive reply, but didn't for %s", lookup)