aboutsummaryrefslogtreecommitdiff
path: root/plugin/forward/setup_test.go
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2021-05-20 03:24:36 -0400
committerGravatar GitHub <noreply@github.com> 2021-05-20 09:24:36 +0200
commit0348b019be984a5e21c40d00d37da2bbcc7d1b20 (patch)
tree7d17b68714b531901e896217dfe7ea15f5dd8e82 /plugin/forward/setup_test.go
parent5d80a6e21e415262a4753760032f4d8fdc8d1216 (diff)
downloadcoredns-0348b019be984a5e21c40d00d37da2bbcc7d1b20.tar.gz
coredns-0348b019be984a5e21c40d00d37da2bbcc7d1b20.tar.zst
coredns-0348b019be984a5e21c40d00d37da2bbcc7d1b20.zip
plugin/forward: Document and warn for unsupported FROM CIDR notations (#4639)
* trap unsupported FROM cidr notations Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * make is a warning Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin/forward/setup_test.go')
-rw-r--r--plugin/forward/setup_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugin/forward/setup_test.go b/plugin/forward/setup_test.go
index ac62f2fa8..6e1b6c06a 100644
--- a/plugin/forward/setup_test.go
+++ b/plugin/forward/setup_test.go
@@ -32,6 +32,7 @@ func TestSetup(t *testing.T) {
{"forward . [::1]:53", false, ".", nil, 2, options{hcRecursionDesired: true}, ""},
{"forward . [2003::1]:53", false, ".", nil, 2, options{hcRecursionDesired: true}, ""},
{"forward . 127.0.0.1 \n", false, ".", nil, 2, options{hcRecursionDesired: true}, ""},
+ {"forward 10.9.3.0/18 127.0.0.1", false, "0.9.10.in-addr.arpa.", nil, 2, options{hcRecursionDesired: true}, ""},
// negative
{"forward . a27.0.0.1", true, "", nil, 0, options{hcRecursionDesired: true}, "not an IP"},
{"forward . 127.0.0.1 {\nblaatl\n}\n", true, "", nil, 0, options{hcRecursionDesired: true}, "unknown property"},
@@ -50,7 +51,7 @@ func TestSetup(t *testing.T) {
if err != nil {
if !test.shouldErr {
- t.Errorf("Test %d: expected no error but found one for input %s, got: %v", i, test.input, err)
+ t.Fatalf("Test %d: expected no error but found one for input %s, got: %v", i, test.input, err)
}
if !strings.Contains(err.Error(), test.expectedErr) {