aboutsummaryrefslogtreecommitdiff
path: root/test/kubernetes_test.go
diff options
context:
space:
mode:
authorGravatar John Belamaric <jbelamaric@infoblox.com> 2016-11-05 07:57:08 -0400
committerGravatar Miek Gieben <miek@miek.nl> 2016-11-05 11:57:08 +0000
commit229c82c41847e19a1bf1764a6cdef07e306db221 (patch)
tree25d7e18c2ba5c1844eea7295edd8b00e8cc4e1b4 /test/kubernetes_test.go
parent775d26c5e2c09e969dbf4141d82cd7ab6565e6aa (diff)
downloadcoredns-229c82c41847e19a1bf1764a6cdef07e306db221.tar.gz
coredns-229c82c41847e19a1bf1764a6cdef07e306db221.tar.zst
coredns-229c82c41847e19a1bf1764a6cdef07e306db221.zip
Fix k8s client (#379)
* Fix k8s client to use client-go * Fix Kubernetes Build Issue The client-go code requires you to vendor. I have done a hack here in the Makefile to vendor it to version 1.5. But looks like we will need to do this the 'right' way soon. * Convert v1 to api Objects in List Functions Also removed the endpoint controller which was not used for anything. The Watch functions may still need the same treatment. * Vendor client-go release-1.5 * Fix basic SRV feature This is actually not serving SRV records correctly, but this should get it to work as it did prior to the k8s client changes. Another fix will be needed to serve SRV records as defined in the spec. * Add additional output in test result Add the response to the test output. * Fix erroneous test data
Diffstat (limited to 'test/kubernetes_test.go')
-rw-r--r--test/kubernetes_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/kubernetes_test.go b/test/kubernetes_test.go
index 83a7b65d2..2f4cb1c18 100644
--- a/test/kubernetes_test.go
+++ b/test/kubernetes_test.go
@@ -56,11 +56,11 @@ var testdataLookupSRV = []struct {
{"mynginx.any.coredns.local.", 1, 1}, // One SRV record, via wildcard namespace
{"someservicethatdoesnotexist.*.coredns.local.", 0, 0}, // Record does not exist with wildcard for namespace
{"someservicethatdoesnotexist.any.coredns.local.", 0, 0}, // Record does not exist with wildcard for namespace
- {"*.demo.coredns.local.", 1, 1}, // One SRV record, via wildcard
- {"any.demo.coredns.local.", 1, 1}, // One SRV record, via wildcard
+ {"*.demo.coredns.local.", 2, 2}, // Two (mynginx, webserver) SRV record, via wildcard
+ {"any.demo.coredns.local.", 2, 2}, // Two (mynginx, webserver) SRV record, via wildcard
{"*.test.coredns.local.", 0, 0}, // One SRV record, via wildcard that is not exposed
{"any.test.coredns.local.", 0, 0}, // One SRV record, via wildcard that is not exposed
- {"*.*.coredns.local.", 1, 1}, // One SRV record, via namespace and service wildcard
+ {"*.*.coredns.local.", 2, 2}, // Two SRV record, via namespace and service wildcard
}
func TestKubernetesIntegration(t *testing.T) {
@@ -89,7 +89,7 @@ func testLookupA(t *testing.T) {
corefile :=
`.:0 {
kubernetes coredns.local {
- endpoint http://localhost:8080
+ endpoint http://localhost:8080
namespaces demo
}
@@ -135,7 +135,7 @@ func testLookupSRV(t *testing.T) {
corefile :=
`.:0 {
kubernetes coredns.local {
- endpoint http://localhost:8080
+ endpoint http://localhost:8080
namespaces demo
}
`
@@ -171,10 +171,10 @@ func testLookupSRV(t *testing.T) {
}
if srvRecordCount != testData.SRVRecordCount {
- t.Errorf("Expected '%v' SRV records in response. Instead got '%v' SRV records. Test query string: '%v'", testData.SRVRecordCount, srvRecordCount, testData.Query)
+ t.Errorf("Expected '%v' SRV records in response. Instead got '%v' SRV records. Test query string: '%v', res: %v", testData.SRVRecordCount, srvRecordCount, testData.Query, res)
}
if len(res.Answer) != testData.TotalAnswerCount {
- t.Errorf("Expected '%v' records in answer section. Instead got '%v' records in answer section. Test query string: '%v'", testData.TotalAnswerCount, len(res.Answer), testData.Query)
+ t.Errorf("Expected '%v' records in answer section. Instead got '%v' records in answer section. Test query string: '%v', res: %v", testData.TotalAnswerCount, len(res.Answer), testData.Query, res)
}
}
}