|
|
@ -187,10 +187,7 @@ func TestRDNSNameToIPv6(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestResolveLocal(t *testing.T) {
|
|
|
|
func TestResolveLocal(t *testing.T) {
|
|
|
|
r, err := New(t.Logf, nil)
|
|
|
|
r := New(t.Logf, nil)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("start: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defer r.Close()
|
|
|
|
defer r.Close()
|
|
|
|
|
|
|
|
|
|
|
|
r.SetConfig(dnsCfg)
|
|
|
|
r.SetConfig(dnsCfg)
|
|
|
@ -230,10 +227,7 @@ func TestResolveLocal(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestResolveLocalReverse(t *testing.T) {
|
|
|
|
func TestResolveLocalReverse(t *testing.T) {
|
|
|
|
r, err := New(t.Logf, nil)
|
|
|
|
r := New(t.Logf, nil)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("start: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defer r.Close()
|
|
|
|
defer r.Close()
|
|
|
|
|
|
|
|
|
|
|
|
r.SetConfig(dnsCfg)
|
|
|
|
r.SetConfig(dnsCfg)
|
|
|
@ -287,10 +281,7 @@ func TestDelegate(t *testing.T) {
|
|
|
|
"nxdomain.site.", resolveToNXDOMAIN)
|
|
|
|
"nxdomain.site.", resolveToNXDOMAIN)
|
|
|
|
defer v6server.Shutdown()
|
|
|
|
defer v6server.Shutdown()
|
|
|
|
|
|
|
|
|
|
|
|
r, err := New(t.Logf, nil)
|
|
|
|
r := New(t.Logf, nil)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("start: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defer r.Close()
|
|
|
|
defer r.Close()
|
|
|
|
|
|
|
|
|
|
|
|
cfg := dnsCfg
|
|
|
|
cfg := dnsCfg
|
|
|
@ -365,10 +356,7 @@ func TestDelegateSplitRoute(t *testing.T) {
|
|
|
|
"test.other.", resolveToIP(test4, test6, "dns.other."))
|
|
|
|
"test.other.", resolveToIP(test4, test6, "dns.other."))
|
|
|
|
defer server2.Shutdown()
|
|
|
|
defer server2.Shutdown()
|
|
|
|
|
|
|
|
|
|
|
|
r, err := New(t.Logf, nil)
|
|
|
|
r := New(t.Logf, nil)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("start: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defer r.Close()
|
|
|
|
defer r.Close()
|
|
|
|
|
|
|
|
|
|
|
|
cfg := dnsCfg
|
|
|
|
cfg := dnsCfg
|
|
|
@ -425,10 +413,7 @@ func TestDelegateCollision(t *testing.T) {
|
|
|
|
"test.site.", resolveToIP(testipv4, testipv6, "dns.test.site."))
|
|
|
|
"test.site.", resolveToIP(testipv4, testipv6, "dns.test.site."))
|
|
|
|
defer server.Shutdown()
|
|
|
|
defer server.Shutdown()
|
|
|
|
|
|
|
|
|
|
|
|
r, err := New(t.Logf, nil)
|
|
|
|
r := New(t.Logf, nil)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("start: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defer r.Close()
|
|
|
|
defer r.Close()
|
|
|
|
|
|
|
|
|
|
|
|
cfg := dnsCfg
|
|
|
|
cfg := dnsCfg
|
|
|
@ -642,10 +627,7 @@ var emptyResponse = []byte{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestFull(t *testing.T) {
|
|
|
|
func TestFull(t *testing.T) {
|
|
|
|
r, err := New(t.Logf, nil)
|
|
|
|
r := New(t.Logf, nil)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("start: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defer r.Close()
|
|
|
|
defer r.Close()
|
|
|
|
|
|
|
|
|
|
|
|
r.SetConfig(dnsCfg)
|
|
|
|
r.SetConfig(dnsCfg)
|
|
|
@ -681,10 +663,7 @@ func TestFull(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestAllocs(t *testing.T) {
|
|
|
|
func TestAllocs(t *testing.T) {
|
|
|
|
r, err := New(t.Logf, nil)
|
|
|
|
r := New(t.Logf, nil)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("start: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defer r.Close()
|
|
|
|
defer r.Close()
|
|
|
|
r.SetConfig(dnsCfg)
|
|
|
|
r.SetConfig(dnsCfg)
|
|
|
|
|
|
|
|
|
|
|
@ -739,10 +718,7 @@ func BenchmarkFull(b *testing.B) {
|
|
|
|
"test.site.", resolveToIP(testipv4, testipv6, "dns.test.site."))
|
|
|
|
"test.site.", resolveToIP(testipv4, testipv6, "dns.test.site."))
|
|
|
|
defer server.Shutdown()
|
|
|
|
defer server.Shutdown()
|
|
|
|
|
|
|
|
|
|
|
|
r, err := New(b.Logf, nil)
|
|
|
|
r := New(b.Logf, nil)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
b.Fatalf("start: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defer r.Close()
|
|
|
|
defer r.Close()
|
|
|
|
|
|
|
|
|
|
|
|
cfg := dnsCfg
|
|
|
|
cfg := dnsCfg
|
|
|
|