aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/auto_test.go5
-rw-r--r--test/chaos_test.go4
-rw-r--r--test/ds_file_test.go4
-rw-r--r--test/etcd_cache_test.go3
-rw-r--r--test/etcd_test.go3
-rw-r--r--test/file_cname_proxy_test.go4
-rw-r--r--test/file_serve_test.go4
-rw-r--r--test/file_srv_additional_test.go3
-rw-r--r--test/grpc_test.go4
-rw-r--r--test/hosts_file_test.go4
-rw-r--r--test/log_test.go5
-rw-r--r--test/metrics_test.go3
-rw-r--r--test/plugin_dnssec_test.go2
-rw-r--r--test/plugin_test.go3
-rw-r--r--test/proxy_health_test.go7
-rw-r--r--test/proxy_http_health_test.go4
-rw-r--r--test/proxy_test.go8
-rw-r--r--test/readme_test.go3
-rw-r--r--test/reverse_test.go4
-rw-r--r--test/rewrite_test.go4
-rw-r--r--test/server.go3
-rw-r--r--test/wildcard_test.go4
22 files changed, 6 insertions, 82 deletions
diff --git a/test/auto_test.go b/test/auto_test.go
index ff130188b..275d84b06 100644
--- a/test/auto_test.go
+++ b/test/auto_test.go
@@ -2,7 +2,6 @@ package test
import (
"io/ioutil"
- "log"
"os"
"path"
"testing"
@@ -35,8 +34,6 @@ func TestAuto(t *testing.T) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
@@ -82,7 +79,6 @@ func TestAutoNonExistentZone(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- log.SetOutput(ioutil.Discard)
corefile := `.:0 {
auto {
@@ -117,7 +113,6 @@ func TestAutoNonExistentZone(t *testing.T) {
func TestAutoAXFR(t *testing.T) {
t.Parallel()
- log.SetOutput(ioutil.Discard)
tmpdir, err := ioutil.TempDir(os.TempDir(), "coredns")
if err != nil {
diff --git a/test/chaos_test.go b/test/chaos_test.go
index 991b6aa85..af5cbdf84 100644
--- a/test/chaos_test.go
+++ b/test/chaos_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
// Plug in CoreDNS, needed for AppVersion and AppName in this test.
@@ -24,8 +22,6 @@ func TestChaos(t *testing.T) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
m := new(dns.Msg)
m.SetQuestion("version.bind.", dns.TypeTXT)
m.Question[0].Qclass = dns.ClassCHAOS
diff --git a/test/ds_file_test.go b/test/ds_file_test.go
index 356fd2b0b..2b2be5795 100644
--- a/test/ds_file_test.go
+++ b/test/ds_file_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/proxy"
@@ -49,8 +47,6 @@ func TestLookupDS(t *testing.T) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
p := proxy.NewLookup([]string{udp})
state := request.Request{W: &mtest.ResponseWriter{}, Req: new(dns.Msg)}
diff --git a/test/etcd_cache_test.go b/test/etcd_cache_test.go
index a0be86dc7..df670e107 100644
--- a/test/etcd_cache_test.go
+++ b/test/etcd_cache_test.go
@@ -4,8 +4,6 @@ package test
import (
"context"
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/etcd/msg"
@@ -33,7 +31,6 @@ func TestEtcdCache(t *testing.T) {
defer ex.Stop()
etc := etcdPlugin()
- log.SetOutput(ioutil.Discard)
var ctx = context.TODO()
for _, serv := range servicesCacheTest {
diff --git a/test/etcd_test.go b/test/etcd_test.go
index 2077ca985..134b2e63b 100644
--- a/test/etcd_test.go
+++ b/test/etcd_test.go
@@ -5,8 +5,6 @@ package test
import (
"context"
"encoding/json"
- "io/ioutil"
- "log"
"testing"
"time"
@@ -53,7 +51,6 @@ func TestEtcdStubAndProxyLookup(t *testing.T) {
defer ex.Stop()
etc := etcdPlugin()
- log.SetOutput(ioutil.Discard)
var ctx = context.TODO()
for _, serv := range servicesStub { // adds example.{net,org} as stubs
diff --git a/test/file_cname_proxy_test.go b/test/file_cname_proxy_test.go
index b0adcf203..6d086e091 100644
--- a/test/file_cname_proxy_test.go
+++ b/test/file_cname_proxy_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/proxy"
@@ -14,7 +12,6 @@ import (
func TestZoneExternalCNAMELookupWithoutProxy(t *testing.T) {
t.Parallel()
- log.SetOutput(ioutil.Discard)
name, rm, err := TempFile(".", exampleOrg)
if err != nil {
@@ -48,7 +45,6 @@ func TestZoneExternalCNAMELookupWithoutProxy(t *testing.T) {
func TestZoneExternalCNAMELookupWithProxy(t *testing.T) {
t.Parallel()
- log.SetOutput(ioutil.Discard)
name, rm, err := TempFile(".", exampleOrg)
if err != nil {
diff --git a/test/file_serve_test.go b/test/file_serve_test.go
index 3aca45bfb..3f0674dfd 100644
--- a/test/file_serve_test.go
+++ b/test/file_serve_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/miekg/dns"
@@ -10,7 +8,6 @@ import (
func TestZoneEDNS0Lookup(t *testing.T) {
t.Parallel()
- log.SetOutput(ioutil.Discard)
name, rm, err := TempFile(".", `$ORIGIN example.org.
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
@@ -58,7 +55,6 @@ www IN AAAA ::1
func TestZoneNoNS(t *testing.T) {
t.Parallel()
- log.SetOutput(ioutil.Discard)
name, rm, err := TempFile(".", `$ORIGIN example.org.
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
diff --git a/test/file_srv_additional_test.go b/test/file_srv_additional_test.go
index 26ae1f9aa..106ae7faa 100644
--- a/test/file_srv_additional_test.go
+++ b/test/file_srv_additional_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/proxy"
@@ -14,7 +12,6 @@ import (
func TestZoneSRVAdditional(t *testing.T) {
t.Parallel()
- log.SetOutput(ioutil.Discard)
name, rm, err := TempFile(".", exampleOrg)
if err != nil {
diff --git a/test/grpc_test.go b/test/grpc_test.go
index acbd822d7..fe273e789 100644
--- a/test/grpc_test.go
+++ b/test/grpc_test.go
@@ -2,8 +2,6 @@ package test
import (
"context"
- "io/ioutil"
- "log"
"testing"
"time"
@@ -14,8 +12,6 @@ import (
)
func TestGrpc(t *testing.T) {
- log.SetOutput(ioutil.Discard)
-
corefile := `grpc://.:0 {
whoami
}
diff --git a/test/hosts_file_test.go b/test/hosts_file_test.go
index 37ad43bc9..8e017aafa 100644
--- a/test/hosts_file_test.go
+++ b/test/hosts_file_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/proxy"
@@ -26,8 +24,6 @@ func TestHostsInlineLookup(t *testing.T) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
diff --git a/test/log_test.go b/test/log_test.go
new file mode 100644
index 000000000..51d972d5a
--- /dev/null
+++ b/test/log_test.go
@@ -0,0 +1,5 @@
+package test
+
+import clog "github.com/coredns/coredns/plugin/pkg/log"
+
+func init() { clog.Discard() }
diff --git a/test/metrics_test.go b/test/metrics_test.go
index 4a1665c5b..58838e1e8 100644
--- a/test/metrics_test.go
+++ b/test/metrics_test.go
@@ -2,7 +2,6 @@ package test
import (
"io/ioutil"
- "log"
"os"
"path"
"testing"
@@ -145,8 +144,6 @@ func TestMetricsAuto(t *testing.T) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
// Write db.example.org to get example.org.
if err = ioutil.WriteFile(path.Join(tmpdir, "db.example.org"), []byte(zoneContent), 0644); err != nil {
t.Fatal(err)
diff --git a/test/plugin_dnssec_test.go b/test/plugin_dnssec_test.go
index 3f8157b21..d48966927 100644
--- a/test/plugin_dnssec_test.go
+++ b/test/plugin_dnssec_test.go
@@ -2,7 +2,6 @@ package test
import (
"io/ioutil"
- "log"
"os"
"testing"
@@ -36,7 +35,6 @@ func TestLookupBalanceRewriteCacheDnssec(t *testing.T) {
}
defer ex.Stop()
- log.SetOutput(ioutil.Discard)
c := new(dns.Client)
m := new(dns.Msg)
m.SetQuestion("example.org.", dns.TypeA)
diff --git a/test/plugin_test.go b/test/plugin_test.go
index cf1680d72..4003a958f 100644
--- a/test/plugin_test.go
+++ b/test/plugin_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/test"
@@ -34,7 +32,6 @@ func benchmarkLookupBalanceRewriteCache(b *testing.B) {
}
defer ex.Stop()
- log.SetOutput(ioutil.Discard)
c := new(dns.Client)
m := new(dns.Msg)
m.SetQuestion("example.org.", dns.TypeA)
diff --git a/test/proxy_health_test.go b/test/proxy_health_test.go
index 8d7c229b8..b0677691c 100644
--- a/test/proxy_health_test.go
+++ b/test/proxy_health_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/proxy"
@@ -13,8 +11,6 @@ import (
)
func TestProxyErratic(t *testing.T) {
- log.SetOutput(ioutil.Discard)
-
corefile := `example.org:0 {
erratic {
drop 2
@@ -39,8 +35,7 @@ func TestProxyErratic(t *testing.T) {
func TestProxyThreeWay(t *testing.T) {
// Run 3 CoreDNS server, 2 upstream ones and a proxy. 1 Upstream is unhealthy after 1 query, but after
- // that we should still be able to send to the other one
- log.SetOutput(ioutil.Discard)
+ // that we should still be able to send to the other one.
// Backend CoreDNS's.
corefileUp1 := `example.org:0 {
diff --git a/test/proxy_http_health_test.go b/test/proxy_http_health_test.go
index 8ea778864..bda5a0f90 100644
--- a/test/proxy_http_health_test.go
+++ b/test/proxy_http_health_test.go
@@ -2,8 +2,6 @@ package test
import (
"io"
- "io/ioutil"
- "log"
"net"
"net/http"
"net/http/httptest"
@@ -17,8 +15,6 @@ import (
)
func TestProxyWithHTTPCheckOK(t *testing.T) {
- log.SetOutput(ioutil.Discard)
-
healthCheckServer := httptest.NewServer(http.HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
diff --git a/test/proxy_test.go b/test/proxy_test.go
index d25ace689..87a05a21e 100644
--- a/test/proxy_test.go
+++ b/test/proxy_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/proxy"
@@ -31,8 +29,6 @@ func TestLookupProxy(t *testing.T) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "example.org.", dns.TypeA)
@@ -70,8 +66,6 @@ func TestLookupDnsWithForcedTcp(t *testing.T) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
p := proxy.NewLookupWithOption([]string{tcp}, proxy.Options{ForceTCP: true})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "example.org.", dns.TypeA)
@@ -114,8 +108,6 @@ func BenchmarkProxyLookup(b *testing.B) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
diff --git a/test/readme_test.go b/test/readme_test.go
index f8ae0e346..4d216b8c8 100644
--- a/test/readme_test.go
+++ b/test/readme_test.go
@@ -3,7 +3,6 @@ package test
import (
"bufio"
"io/ioutil"
- "log"
"os"
"path/filepath"
"strconv"
@@ -48,8 +47,6 @@ func TestReadme(t *testing.T) {
create(contents)
defer remove(contents)
- log.SetOutput(ioutil.Discard)
-
middle := filepath.Join("..", "plugin")
dirs, err := ioutil.ReadDir(middle)
if err != nil {
diff --git a/test/reverse_test.go b/test/reverse_test.go
index 4ff74c737..962601a28 100644
--- a/test/reverse_test.go
+++ b/test/reverse_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/proxy"
@@ -28,8 +26,6 @@ func TestReverseCorefile(t *testing.T) {
t.Fatalf("Could not get UDP listening port")
}
- log.SetOutput(ioutil.Discard)
-
p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
resp, err := p.Lookup(state, "17.0.0.10.in-addr.arpa.", dns.TypePTR)
diff --git a/test/rewrite_test.go b/test/rewrite_test.go
index 0ec3a9a70..34795413d 100644
--- a/test/rewrite_test.go
+++ b/test/rewrite_test.go
@@ -2,8 +2,6 @@ package test
import (
"bytes"
- "io/ioutil"
- "log"
"testing"
"github.com/miekg/dns"
@@ -26,8 +24,6 @@ func TestRewrite(t *testing.T) {
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
testMX(t, udp)
testEdns0(t, udp)
}
diff --git a/test/server.go b/test/server.go
index 4a0c200ee..bdd31a434 100644
--- a/test/server.go
+++ b/test/server.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"sync"
"github.com/coredns/coredns/core/dnsserver"
@@ -21,7 +19,6 @@ func CoreDNSServer(corefile string) (*caddy.Instance, error) {
defer mu.Unlock()
caddy.Quiet = true
dnsserver.Quiet = true
- log.SetOutput(ioutil.Discard)
return caddy.Start(NewInput(corefile))
}
diff --git a/test/wildcard_test.go b/test/wildcard_test.go
index f34b5c0eb..b04affe6b 100644
--- a/test/wildcard_test.go
+++ b/test/wildcard_test.go
@@ -1,8 +1,6 @@
package test
import (
- "io/ioutil"
- "log"
"testing"
"github.com/coredns/coredns/plugin/proxy"
@@ -31,8 +29,6 @@ func TestLookupWildcard(t *testing.T) {
}
defer i.Stop()
- log.SetOutput(ioutil.Discard)
-
p := proxy.NewLookup([]string{udp})
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}