aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/auto_test.go6
-rw-r--r--test/cache_test.go4
-rw-r--r--test/ds_file_test.go2
-rw-r--r--test/etcd_cache_debug_test.go2
-rw-r--r--test/etcd_test.go7
-rw-r--r--test/file_reload_test.go2
-rw-r--r--test/proxy_health_test.go2
-rw-r--r--test/proxy_test.go4
-rw-r--r--test/wildcard_test.go2
9 files changed, 15 insertions, 16 deletions
diff --git a/test/auto_test.go b/test/auto_test.go
index 7b615765a..279dedcbc 100644
--- a/test/auto_test.go
+++ b/test/auto_test.go
@@ -42,7 +42,7 @@ func TestAuto(t *testing.T) {
log.SetOutput(ioutil.Discard)
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "www.example.org.", dns.TypeA)
@@ -108,7 +108,7 @@ func TestAutoNonExistentZone(t *testing.T) {
}
defer i.Stop()
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "example.org.", dns.TypeA)
@@ -155,7 +155,7 @@ func TestAutoAXFR(t *testing.T) {
time.Sleep(1100 * time.Millisecond) // wait for it to be picked up
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
m := new(dns.Msg)
m.SetAxfr("example.org.")
state := request.Request{W: &test.ResponseWriter{}, Req: m}
diff --git a/test/cache_test.go b/test/cache_test.go
index f1cdbe76f..1d4517969 100644
--- a/test/cache_test.go
+++ b/test/cache_test.go
@@ -56,7 +56,7 @@ func TestLookupCache(t *testing.T) {
log.SetOutput(ioutil.Discard)
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "example.org.", dns.TypeA)
@@ -65,7 +65,7 @@ func TestLookupCache(t *testing.T) {
}
// expect answer section with A record in it
if len(resp.Answer) == 0 {
- t.Error("Expected to at least one RR in the answer section, got none")
+ t.Fatal("Expected to at least one RR in the answer section, got none")
}
ttl := resp.Answer[0].Header().Ttl
diff --git a/test/ds_file_test.go b/test/ds_file_test.go
index b1fd7b2df..fdca58f73 100644
--- a/test/ds_file_test.go
+++ b/test/ds_file_test.go
@@ -57,7 +57,7 @@ func TestLookupDS(t *testing.T) {
log.SetOutput(ioutil.Discard)
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &mtest.ResponseWriter{}, Req: new(dns.Msg)}
for _, tc := range dsTestCases {
diff --git a/test/etcd_cache_debug_test.go b/test/etcd_cache_debug_test.go
index 5343ad620..775dd1a58 100644
--- a/test/etcd_cache_debug_test.go
+++ b/test/etcd_cache_debug_test.go
@@ -47,7 +47,7 @@ func TestEtcdCacheAndDebug(t *testing.T) {
defer delete(ctx, t, etc, serv.Key)
}
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "b.example.skydns.test.", dns.TypeA)
diff --git a/test/etcd_test.go b/test/etcd_test.go
index f627e3872..145b83a48 100644
--- a/test/etcd_test.go
+++ b/test/etcd_test.go
@@ -66,15 +66,14 @@ func TestEtcdStubAndProxyLookup(t *testing.T) {
defer delete(ctx, t, etc, serv.Key)
}
- p := proxy.New([]string{udp}) // use udp port from the server
+ p := proxy.NewLookup([]string{udp}) // use udp port from the server
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "example.com.", dns.TypeA)
if err != nil {
- t.Error("Expected to receive reply, but didn't")
- return
+ t.Fatalf("Expected to receive reply, but didn't", err)
}
if len(resp.Answer) == 0 {
- t.Error("Expected to at least one RR in the answer section, got none")
+ t.Fatalf("Expected to at least one RR in the answer section, got none")
}
if resp.Answer[0].Header().Rrtype != dns.TypeA {
t.Errorf("Expected RR to A, got: %d", resp.Answer[0].Header().Rrtype)
diff --git a/test/file_reload_test.go b/test/file_reload_test.go
index 0e0bcadfc..cb6a8e940 100644
--- a/test/file_reload_test.go
+++ b/test/file_reload_test.go
@@ -42,7 +42,7 @@ example.net:0 {
}
defer i.Stop()
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "example.org.", dns.TypeA)
diff --git a/test/proxy_health_test.go b/test/proxy_health_test.go
index 143846688..11c42e9a5 100644
--- a/test/proxy_health_test.go
+++ b/test/proxy_health_test.go
@@ -33,7 +33,7 @@ func TestProxyErratic(t *testing.T) {
}
defer backend.Stop()
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
// We do one lookup that should not time out.
diff --git a/test/proxy_test.go b/test/proxy_test.go
index 01bfa0500..3f22a6cb9 100644
--- a/test/proxy_test.go
+++ b/test/proxy_test.go
@@ -38,7 +38,7 @@ func TestLookupProxy(t *testing.T) {
log.SetOutput(ioutil.Discard)
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "example.org.", dns.TypeA)
if err != nil {
@@ -82,7 +82,7 @@ func BenchmarkLookupProxy(b *testing.B) {
log.SetOutput(ioutil.Discard)
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
b.ResetTimer()
diff --git a/test/wildcard_test.go b/test/wildcard_test.go
index d6910e013..83e12ea03 100644
--- a/test/wildcard_test.go
+++ b/test/wildcard_test.go
@@ -38,7 +38,7 @@ func TestLookupWildcard(t *testing.T) {
log.SetOutput(ioutil.Discard)
- p := proxy.New([]string{udp})
+ p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
for _, lookup := range []string{"a.w.example.org.", "a.a.w.example.org."} {