aboutsummaryrefslogtreecommitdiff
path: root/test/kubernetes_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-08-14 08:49:26 +0100
committerGravatar GitHub <noreply@github.com> 2017-08-14 08:49:26 +0100
commit00f5c7797e265dc2fecad5acbfcfdad9797e48e5 (patch)
tree92d2e98f10a8d25f8b8a9a9239b88ff85f2866b6 /test/kubernetes_test.go
parent818d2b10adc6e69b2f94a50a56ac292a12278861 (diff)
downloadcoredns-00f5c7797e265dc2fecad5acbfcfdad9797e48e5.tar.gz
coredns-00f5c7797e265dc2fecad5acbfcfdad9797e48e5.tar.zst
coredns-00f5c7797e265dc2fecad5acbfcfdad9797e48e5.zip
mw/kubernetes: remove federation and cidr (#916)
* mw/kubernetes: remove federation and cidr Remove both as we have a corefile syntax change that handles cidr and remove federation because that is going to be its own middleware. * backwards incompat changes This PR: * removes cidr from kubernetes (core Corefile feature now) * removes federation from kubernets (comes back as new middleware) * [remove autopath - which was already gone, so that already was backwards incompat] * adds `fallthrough` to the *etcd* middleware and makes you enable it. * Fail on unknown properties * documentation * Disable TestHealthCheck as it uses realtime and fails
Diffstat (limited to 'test/kubernetes_test.go')
-rw-r--r--test/kubernetes_test.go157
1 files changed, 6 insertions, 151 deletions
diff --git a/test/kubernetes_test.go b/test/kubernetes_test.go
index d99ca1618..f9a0b00c4 100644
--- a/test/kubernetes_test.go
+++ b/test/kubernetes_test.go
@@ -3,6 +3,8 @@
package test
import (
+ "io/ioutil"
+ "log"
"os"
"testing"
"time"
@@ -13,6 +15,10 @@ import (
"github.com/miekg/dns"
)
+func init() {
+ log.SetOutput(ioutil.Discard)
+}
+
// Test data
// TODO: Fix the actual RR values
@@ -219,25 +225,6 @@ var dnsTestCases = []test.Case{
Answer: []dns.RR{},
},
{
- Qname: "123.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{},
- },
- {
- Qname: "100.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("100.0.0.10.in-addr.arpa. 303 IN PTR svc-1-a.test-1.svc.cluster.local."),
- },
- },
- {
- Qname: "115.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("115.0.0.10.in-addr.arpa. 303 IN PTR svc-c.test-1.svc.cluster.local."),
- },
- },
- {
Qname: "dns-version.cluster.local.", Qtype: dns.TypeTXT,
Rcode: dns.RcodeSuccess,
Answer: []dns.RR{
@@ -245,13 +232,6 @@ var dnsTestCases = []test.Case{
},
},
{
- Qname: "next-in-chain.", Qtype: dns.TypeA,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.A("next-in-chain. 0 IN A 192.0.2.53"),
- },
- },
- {
Qname: "cluster.local.", Qtype: dns.TypeNS,
Rcode: dns.RcodeSuccess,
Answer: []dns.RR{
@@ -303,80 +283,6 @@ var dnsTestCasesPodsVerified = []test.Case{
},
}
-var dnsTestCasesCidrReverseZone = []test.Case{
- {
- Qname: "123.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{},
- },
- {
- Qname: "100.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("100.0.0.10.in-addr.arpa. 303 IN PTR svc-1-a.test-1.svc.cluster.local."),
- },
- },
- {
- Qname: "110.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("115.0.0.10.in-addr.arpa. 303 IN PTR svc-1-b.test-1.svc.cluster.local."),
- },
- },
- {
- Qname: "115.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("115.0.0.10.in-addr.arpa. 303 IN PTR svc-c.test-1.svc.cluster.local."),
- },
- },
- {
- Qname: "next-in-chain.", Qtype: dns.TypeA,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.A("next-in-chain. 0 IN A 192.0.2.53"),
- },
- },
-}
-
-var dnsTestCasesPartialCidrReverseZone = []test.Case{
- {
- // In exposed range, record not present = OK + No data
- Qname: "99.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{},
- },
- {
- // In exposed range, record present = OK + Data
- Qname: "100.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("100.0.0.10.in-addr.arpa. 303 IN PTR svc-1-a.test-1.svc.cluster.local."),
- },
- },
- {
- // In exposed range, record present = OK + Data
- Qname: "110.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("115.0.0.10.in-addr.arpa. 303 IN PTR svc-1-b.test-1.svc.cluster.local."),
- },
- },
- {
- // Out of exposed range, record present = pass to next middleware (not existing in test) = FAIL
- Qname: "115.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeServerFailure,
- Answer: []dns.RR{},
- },
- {
- Qname: "next-in-chain.", Qtype: dns.TypeA,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.A("next-in-chain. 0 IN A 192.0.2.53"),
- },
- },
-}
-
var dnsTestCasesAllNSExposed = []test.Case{
{
Qname: "svc-1-a.test-1.svc.cluster.local.", Qtype: dns.TypeA,
@@ -392,25 +298,6 @@ var dnsTestCasesAllNSExposed = []test.Case{
test.A("svc-c.test-1.svc.cluster.local. 303 IN A 10.0.0.120"),
},
},
- {
- Qname: "123.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{},
- },
- {
- Qname: "100.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("100.0.0.10.in-addr.arpa. 303 IN PTR svc-1-a.test-1.svc.cluster.local."),
- },
- },
- {
- Qname: "120.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
- Rcode: dns.RcodeSuccess,
- Answer: []dns.RR{
- test.PTR("120.0.0.10.in-addr.arpa. 303 IN PTR svc-c.test-2.svc.cluster.local."),
- },
- },
}
var dnsTestCasesFallthrough = []test.Case{
@@ -558,42 +445,11 @@ func TestKubernetesIntegrationPodsVerified(t *testing.T) {
doIntegrationTests(t, corefile, dnsTestCasesPodsVerified)
}
-func TestKubernetesIntegrationCidrReverseZone(t *testing.T) {
- corefile :=
- `.:0 {
- kubernetes cluster.local {
- endpoint http://localhost:8080
- namespaces test-1
- cidrs 10.0.0.0/24
- }
- erratic . {
- drop 0
- }
-`
- doIntegrationTests(t, corefile, dnsTestCasesCidrReverseZone)
-}
-
-func TestKubernetesIntegrationPartialCidrReverseZone(t *testing.T) {
- corefile :=
- `.:0 {
- kubernetes cluster.local {
- endpoint http://localhost:8080
- namespaces test-1
- cidrs 10.0.0.96/28 10.0.0.120/32
- }
- erratic . {
- drop 0
- }
-`
- doIntegrationTests(t, corefile, dnsTestCasesPartialCidrReverseZone)
-}
-
func TestKubernetesIntegrationAllNSExposed(t *testing.T) {
corefile :=
`.:0 {
kubernetes cluster.local {
endpoint http://localhost:8080
- cidrs 10.0.0.0/24
}
`
doIntegrationTests(t, corefile, dnsTestCasesAllNSExposed)
@@ -615,7 +471,6 @@ func TestKubernetesIntegrationFallthrough(t *testing.T) {
file ` + dbfile + ` cluster.local
kubernetes cluster.local {
endpoint http://localhost:8080
- cidrs 10.0.0.0/24
namespaces test-1
upstream ` + udp + `
fallthrough