aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite/rewrite_test.go
diff options
context:
space:
mode:
authorGravatar Eugen Kleiner <ekleiner@infoblox.com> 2018-06-29 12:44:16 +0300
committerGravatar Miek Gieben <miek@miek.nl> 2018-06-29 10:44:16 +0100
commit17d807f05fddbcd58656cd6888c7d5b85d52e441 (patch)
tree891c9f786bd4591dd2a3fb3545d5889dd195922a /plugin/rewrite/rewrite_test.go
parentdae506b5638c7309399cb273d7f76bc20ee518dd (diff)
downloadcoredns-17d807f05fddbcd58656cd6888c7d5b85d52e441.tar.gz
coredns-17d807f05fddbcd58656cd6888c7d5b85d52e441.tar.zst
coredns-17d807f05fddbcd58656cd6888c7d5b85d52e441.zip
plugin/metadata: add metadata plugin (#1894)
* plugin/metadata: add metadata plugin * plugin/metadata: Add MD struct, refactor code, fix doc * plugin/metadata: simplify metadata key * plugin/metadata: improve setup_test * Support of metadata by rewrite plugin. Move calculated variables to metadata. * Move variables from metadata to pkg, add UTs, READMEs change, metadata small fixes * Add client port validation to variables_test * plugin/metadata: improve README * plugin/metadata: rename methods * plugin/metadata: Update Metadataer interface, update doc, cosmetic code changes * plugin/metadata: move colllisions check to OnStartup(). Fix default variables metadataer. * plugin/metadata: Fix comment for method setValue * plugin/metadata: change variables order to fix linter warning * plugin/metadata: rename Metadataer to Provider
Diffstat (limited to 'plugin/rewrite/rewrite_test.go')
-rw-r--r--plugin/rewrite/rewrite_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/rewrite/rewrite_test.go b/plugin/rewrite/rewrite_test.go
index 56c446f49..b35543b9b 100644
--- a/plugin/rewrite/rewrite_test.go
+++ b/plugin/rewrite/rewrite_test.go
@@ -71,7 +71,7 @@ func TestNewRule(t *testing.T) {
{[]string{"edns0", "nsid", "append"}, false, reflect.TypeOf(&edns0NsidRule{})},
{[]string{"edns0", "nsid", "replace"}, false, reflect.TypeOf(&edns0NsidRule{})},
{[]string{"edns0", "nsid", "foo"}, true, nil},
- {[]string{"edns0", "local", "set", "0xffee", "{dummy}"}, true, nil},
+ {[]string{"edns0", "local", "set", "0xffee", "{dummy}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "set", "0xffee", "{qname}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "set", "0xffee", "{qtype}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "set", "0xffee", "{client_ip}"}, false, reflect.TypeOf(&edns0VariableRule{})},
@@ -79,7 +79,7 @@ func TestNewRule(t *testing.T) {
{[]string{"edns0", "local", "set", "0xffee", "{protocol}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "set", "0xffee", "{server_ip}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "set", "0xffee", "{server_port}"}, false, reflect.TypeOf(&edns0VariableRule{})},
- {[]string{"edns0", "local", "append", "0xffee", "{dummy}"}, true, nil},
+ {[]string{"edns0", "local", "append", "0xffee", "{dummy}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "append", "0xffee", "{qname}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "append", "0xffee", "{qtype}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "append", "0xffee", "{client_ip}"}, false, reflect.TypeOf(&edns0VariableRule{})},
@@ -87,7 +87,7 @@ func TestNewRule(t *testing.T) {
{[]string{"edns0", "local", "append", "0xffee", "{protocol}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "append", "0xffee", "{server_ip}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "append", "0xffee", "{server_port}"}, false, reflect.TypeOf(&edns0VariableRule{})},
- {[]string{"edns0", "local", "replace", "0xffee", "{dummy}"}, true, nil},
+ {[]string{"edns0", "local", "replace", "0xffee", "{dummy}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "replace", "0xffee", "{qname}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "replace", "0xffee", "{qtype}"}, false, reflect.TypeOf(&edns0VariableRule{})},
{[]string{"edns0", "local", "replace", "0xffee", "{client_ip}"}, false, reflect.TypeOf(&edns0VariableRule{})},