All (non etcd) tests are now local (#105)

We don't need to network to do tests, we up enough local servers
to we don't need to forward to,s say 8.8.8.8
This commit is contained in:
Miek Gieben
2016-04-11 15:56:22 +01:00
parent 31ce53f514
commit 9f651a397b
6 changed files with 89 additions and 45 deletions

View File

@@ -11,7 +11,7 @@ import (
"github.com/miekg/dns"
)
func testMsg(zone string, typ uint16, o *dns.OPT) *dns.Msg {
func Msg(zone string, typ uint16, o *dns.OPT) *dns.Msg {
m := new(dns.Msg)
m.SetQuestion(zone, typ)
if o != nil {
@@ -20,14 +20,14 @@ func testMsg(zone string, typ uint16, o *dns.OPT) *dns.Msg {
return m
}
func testExchange(m *dns.Msg, server, net string) (*dns.Msg, error) {
func Exchange(m *dns.Msg, server, net string) (*dns.Msg, error) {
c := new(dns.Client)
c.Net = net
return middleware.Exchange(c, m, server)
}
// testServer returns a test server and the tcp and udp listeners addresses.
func testServer(t *testing.T, corefile string) (*server.Server, string, string, error) {
// Server returns a test server and the tcp and udp listeners addresses.
func Server(t *testing.T, corefile string) (*server.Server, string, string, error) {
srv, err := core.TestServer(t, corefile)
if err != nil {
return nil, "", "", err