plugin/template: add upstream option (#1529)

* add upstream

* docs

* tests
This commit is contained in:
Chris O'Haver 2018-02-16 03:45:25 -05:00 committed by Miek Gieben
parent ba573c0f40
commit 2cad04ec10
4 changed files with 33 additions and 1 deletions

View file

@ -133,6 +133,20 @@ func TestSetupParse(t *testing.T) {
}`,
false,
},
{
`template ANY ANY up.stream.local {
answer "up.stream.local 5 IN CNAME up.river.local"
upstream
}`,
false,
},
{
`template ANY ANY up.stream.local {
answer "up.stream.local 5 IN CNAME up.river.local"
upstream invalid-upstream-argument
}`,
true,
},
}
for i, test := range tests {
c := caddy.NewTestController("dns", test.inputFileRules)