aboutsummaryrefslogtreecommitdiff
path: root/test/server_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-08-19 17:14:17 -0700
committerGravatar GitHub <noreply@github.com> 2016-08-19 17:14:17 -0700
commit9ac3cab1b7b1b1e78f86ce3c6a80fbee312162e6 (patch)
tree437e9755927c33af16276ad2602a6da115f948cb /test/server_test.go
parenta1989c35231b0e5ea271b2f68d82c1a63e697cd0 (diff)
downloadcoredns-9ac3cab1b7b1b1e78f86ce3c6a80fbee312162e6.tar.gz
coredns-9ac3cab1b7b1b1e78f86ce3c6a80fbee312162e6.tar.zst
coredns-9ac3cab1b7b1b1e78f86ce3c6a80fbee312162e6.zip
Make CoreDNS a server type plugin for Caddy (#220)
* Make CoreDNS a server type plugin for Caddy Remove code we don't need and port all middleware over. Fix all tests and rework the documentation. Also make `go generate` build a caddy binary which we then copy into our directory. This means `go build`-builds remain working as-is. And new etc instances in each etcd test for better isolation. Fix more tests and rework test.Server with the newer support Caddy offers. Fix Makefile to support new mode of operation.
Diffstat (limited to 'test/server_test.go')
-rw-r--r--test/server_test.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/server_test.go b/test/server_test.go
index 6a86d022b..a03285bf3 100644
--- a/test/server_test.go
+++ b/test/server_test.go
@@ -12,24 +12,28 @@ func TestProxyToChaosServer(t *testing.T) {
chaos CoreDNS-001 miek@miek.nl
}
`
- chaos, tcpCH, udpCH, err := Server(t, corefile)
+ chaos, err := CoreDNSServer(corefile)
if err != nil {
- t.Fatalf("Could get server: %s", err)
+ t.Fatalf("could not get CoreDNS serving instance: %s", err)
}
+
+ udpChaos, tcpChaos := CoreDNSServerPorts(chaos, 0)
defer chaos.Stop()
corefileProxy := `.:0 {
- proxy . ` + udpCH + `
+ proxy . ` + udpChaos + `
}
`
- proxy, _, udp, err := Server(t, corefileProxy)
+ proxy, err := CoreDNSServer(corefileProxy)
if err != nil {
- t.Fatalf("Could get server: %s", err)
+ t.Fatalf("could not get CoreDNS serving instance")
}
+
+ udp, _ := CoreDNSServerPorts(proxy, 0)
defer proxy.Stop()
- chaosTest(t, udpCH, "udp")
- chaosTest(t, tcpCH, "tcp")
+ chaosTest(t, udpChaos, "udp")
+ chaosTest(t, tcpChaos, "tcp")
chaosTest(t, udp, "udp")
// chaosTest(t, tcp, "tcp"), commented out because we use the original transport to reach the