diff options
author | 2022-03-17 00:30:37 +0800 | |
---|---|---|
committer | 2022-03-16 12:30:37 -0400 | |
commit | 67885575075bb243bbd2241582aa2fbba131c1e5 (patch) | |
tree | fb79d1448c2fd6c9a00b1dcfff339a1eea79994b /plugin | |
parent | 21fc65bfc8cd8f4fb8c07dde7df40a96339333e3 (diff) | |
download | coredns-67885575075bb243bbd2241582aa2fbba131c1e5.tar.gz coredns-67885575075bb243bbd2241582aa2fbba131c1e5.tar.zst coredns-67885575075bb243bbd2241582aa2fbba131c1e5.zip |
plugin/file: add CAA record test case (#5219)
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/file/lookup_test.go | 8 | ||||
-rw-r--r-- | plugin/test/helpers.go | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/plugin/file/lookup_test.go b/plugin/file/lookup_test.go index 02580d227..e84d2fce5 100644 --- a/plugin/file/lookup_test.go +++ b/plugin/file/lookup_test.go @@ -139,6 +139,13 @@ var dnsTestCases = []test.Case{ }, Ns: miekAuth, }, + { + Qname: "caa.miek.nl.", Qtype: dns.TypeCAA, + Answer: []dns.RR{ + test.CAA(`caa.miek.nl. 1800 IN CAA 0 issue letsencrypt.org`), + }, + Ns: miekAuth, + }, } const ( @@ -244,4 +251,5 @@ srv IN SRV 10 10 8080 a.miek.nl. mx IN MX 10 a.miek.nl. txt IN TXT "v=spf1 a mx ~all" +caa IN CAA 0 issue letsencrypt.org ext-cname IN CNAME example.com.` diff --git a/plugin/test/helpers.go b/plugin/test/helpers.go index cb7b0994b..99271df1e 100644 --- a/plugin/test/helpers.go +++ b/plugin/test/helpers.go @@ -82,6 +82,9 @@ func PTR(rr string) *dns.PTR { r, _ := dns.NewRR(rr); return r.(*dns.PTR) } // TXT returns a TXT record from rr. It panics on errors. func TXT(rr string) *dns.TXT { r, _ := dns.NewRR(rr); return r.(*dns.TXT) } +// CAA returns a CAA record from rr. It panics on errors. +func CAA(rr string) *dns.CAA { r, _ := dns.NewRR(rr); return r.(*dns.CAA) } + // HINFO returns a HINFO record from rr. It panics on errors. func HINFO(rr string) *dns.HINFO { r, _ := dns.NewRR(rr); return r.(*dns.HINFO) } |