mirror of
https://github.com/coredns/coredns.git
synced 2025-12-09 20:05:11 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user