pkg: add dnstest (#1098)

Add a full test server impl in this new package + tests. Move
dnsrecorder into this package as well and finish up the commented out
tests that were left in the old dnsrecorder package.

Update all callers and tests.
This commit is contained in:
Miek Gieben
2017-09-21 15:15:47 +01:00
committed by GitHub
parent 7109c6715c
commit 284061eee7
44 changed files with 223 additions and 131 deletions

View File

@@ -5,7 +5,7 @@ import (
"strings"
"time"
"github.com/coredns/coredns/plugin/pkg/dnsrecorder"
"github.com/coredns/coredns/plugin/pkg/dnstest"
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
@@ -31,7 +31,7 @@ type replacer struct {
// values into the replacer. rr may be nil if it is not
// available. emptyValue should be the string that is used
// in place of empty string (can still be empty string).
func New(r *dns.Msg, rr *dnsrecorder.Recorder, emptyValue string) Replacer {
func New(r *dns.Msg, rr *dnstest.Recorder, emptyValue string) Replacer {
req := request.Request{W: rr, Req: r}
rep := replacer{
replacements: map[string]string{