diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/etcd_test.go | 4 | ||||
-rw-r--r-- | test/kubernetes_test.go | 16 | ||||
-rw-r--r-- | test/proxy_test.go | 4 |
3 files changed, 7 insertions, 17 deletions
diff --git a/test/etcd_test.go b/test/etcd_test.go index 6beb4cff2..6645e9931 100644 --- a/test/etcd_test.go +++ b/test/etcd_test.go @@ -77,10 +77,10 @@ func TestEtcdStubAndProxyLookup(t *testing.T) { t.Error("Expected to at least one RR in the answer section, got none") } if resp.Answer[0].Header().Rrtype != dns.TypeA { - t.Error("Expected RR to A, got: %d", resp.Answer[0].Header().Rrtype) + t.Errorf("Expected RR to A, got: %d", resp.Answer[0].Header().Rrtype) } if resp.Answer[0].(*dns.A).A.String() != "93.184.216.34" { - t.Error("Expected 93.184.216.34, got: %d", resp.Answer[0].(*dns.A).A.String()) + t.Errorf("Expected 93.184.216.34, got: %d", resp.Answer[0].(*dns.A).A.String()) } } diff --git a/test/kubernetes_test.go b/test/kubernetes_test.go index 009b50657..c8dce32e4 100644 --- a/test/kubernetes_test.go +++ b/test/kubernetes_test.go @@ -7,8 +7,6 @@ import ( "log" "testing" - "github.com/miekg/coredns/middleware/kubernetes/k8stest" - "github.com/miekg/dns" ) @@ -63,17 +61,13 @@ var testdataLookupSRV = []struct { {"*.*.coredns.local.", 1, 1}, // One SRV record, via namespace and service wildcard } -func TestK8sIntegration(t *testing.T) { +func testK8sIntegration(t *testing.T) { // subtests here (Go 1.7 feature). testLookupA(t) testLookupSRV(t) } func testLookupA(t *testing.T) { - if !k8stest.CheckKubernetesRunning() { - t.Skip("Skipping Kubernetes Integration tests. Kubernetes is not running") - } - corefile := `.:0 { kubernetes coredns.local { @@ -104,7 +98,7 @@ func testLookupA(t *testing.T) { res, _, err := dnsClient.Exchange(dnsMessage, udp) if err != nil { - t.Fatal("Could not send query: %s", err) + t.Fatalf("Could not send query: %s", err) } // Count A records in the answer section ARecordCount := 0 @@ -124,10 +118,6 @@ func testLookupA(t *testing.T) { } func testLookupSRV(t *testing.T) { - if !k8stest.CheckKubernetesRunning() { - t.Skip("Skipping Kubernetes Integration tests. Kubernetes is not running") - } - corefile := `.:0 { kubernetes coredns.local { @@ -159,7 +149,7 @@ func testLookupSRV(t *testing.T) { res, _, err := dnsClient.Exchange(dnsMessage, udp) if err != nil { - t.Fatal("Could not send query: %s", err) + t.Fatalf("Could not send query: %s", err) } // Count SRV records in the answer section srvRecordCount := 0 diff --git a/test/proxy_test.go b/test/proxy_test.go index ca04e1ae8..96a2c4c0d 100644 --- a/test/proxy_test.go +++ b/test/proxy_test.go @@ -56,9 +56,9 @@ func TestLookupProxy(t *testing.T) { t.Error("Expected to at least one RR in the answer section, got none") } if resp.Answer[0].Header().Rrtype != dns.TypeA { - t.Error("Expected RR to A, got: %d", resp.Answer[0].Header().Rrtype) + t.Errorf("Expected RR to A, got: %d", resp.Answer[0].Header().Rrtype) } if resp.Answer[0].(*dns.A).A.String() != "127.0.0.1" { - t.Error("Expected 127.0.0.1, got: %d", resp.Answer[0].(*dns.A).A.String()) + t.Errorf("Expected 127.0.0.1, got: %d", resp.Answer[0].(*dns.A).A.String()) } } |