aboutsummaryrefslogtreecommitdiff
path: root/middleware
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-09-10 19:52:15 +0100
committerGravatar GitHub <noreply@github.com> 2017-09-10 19:52:15 +0100
commit6e3eec1e7274ec1ef9992299c07b038d61a76415 (patch)
tree7982300434f7439e95a9fdbad427fd4d5267edc4 /middleware
parent1b60688dc8f7e7ed0edcda5fb3fec02b1ddd3e42 (diff)
downloadcoredns-6e3eec1e7274ec1ef9992299c07b038d61a76415.tar.gz
coredns-6e3eec1e7274ec1ef9992299c07b038d61a76415.tar.zst
coredns-6e3eec1e7274ec1ef9992299c07b038d61a76415.zip
documention: test README snippets (#1043)
If a README has a corefile snippet that is annotated with `corefile`, this test will parse the instance and checks the snippet is legal. This means a) we will get better docs b) we know for sure everything still parses. The test parses everything in middleware/*/README.md, it does not check for README presence, just Corefile snippets. The port used is 10053 and overrides whatever port is set in the docs. The secondary middleware was used as an example and adds two examples that should parse. failures show up as: ~~~ --- FAIL: TestReadme (0.04s) readme_test.go:50: Testing ../middleware/secondary/README.md, with 100 byte snippet readme_test.go:50: Testing ../middleware/secondary/README.md, with 93 byte snippet readme_test.go:53: Failed to start server for input "middleware/secondary: Corefile:3 - Error during parsing: unknown property 'transfeT'": . { secondary example.net { transfeT from 10.1.2.1 transfer to * } } FAIL ~~~
Diffstat (limited to 'middleware')
-rw-r--r--middleware/secondary/README.md21
1 files changed, 18 insertions, 3 deletions
diff --git a/middleware/secondary/README.md b/middleware/secondary/README.md
index 7d5338c95..d6cbe465a 100644
--- a/middleware/secondary/README.md
+++ b/middleware/secondary/README.md
@@ -31,9 +31,24 @@ secondary [zones...] {
## Examples
+Transfer `example.org` from 10.0.1.1, and if that fails try 10.1.2.1.
+
+~~~ corefile
+example.org {
+ secondary {
+ transfer from 10.0.1.1
+ transfer from 10.1.2.1
+ }
+}
~~~
-secondary example.org {
- transfer from 10.0.1.1
- transfer from 10.1.2.1
+
+Or re-export the retrieved zone to other secondaries.
+
+~~~ corefile
+. {
+ secondary example.net {
+ transfer from 10.1.2.1
+ transfer to *
+ }
}
~~~