aboutsummaryrefslogtreecommitdiff
path: root/plugin/proxy/upstream_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/proxy/upstream_test.go')
-rw-r--r--plugin/proxy/upstream_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugin/proxy/upstream_test.go b/plugin/proxy/upstream_test.go
index 98509f738..6fec3e30a 100644
--- a/plugin/proxy/upstream_test.go
+++ b/plugin/proxy/upstream_test.go
@@ -259,7 +259,7 @@ proxy . FILE
proxy example.org 2.2.2.2:1234
`,
`
-junky resolve.conf
+junky resolv.conf
`,
false,
[]string{"1.1.1.1:5000", "2.2.2.2:1234"},
@@ -303,6 +303,16 @@ junky resolve.conf
}
}
+func TestMaxTo(t *testing.T) {
+ // Has 16 IP addresses.
+ config := `proxy . 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1 1.1.1.1`
+ c := caddy.NewTestController("dns", config)
+ _, err := NewStaticUpstreams(&c.Dispenser)
+ if err == nil {
+ t.Error("Expected to many TOs configured, but nil")
+ }
+}
+
func getPEMFiles(t *testing.T) (rmFunc func(), cert, key, ca string) {
tempDir, rmFunc, err := test.WritePEMFiles("")
if err != nil {