|
7 | 7 | "github.com/coredns/coredns/plugin/pkg/dnstest" |
8 | 8 | "github.com/coredns/coredns/plugin/test" |
9 | 9 |
|
10 | | - "github.com/caddyserver/caddy" |
| 10 | + "github.com/coredns/caddy" |
11 | 11 | "github.com/miekg/dns" |
12 | 12 | ) |
13 | 13 |
|
@@ -76,6 +76,25 @@ func TestLookupNoSOA(t *testing.T) { |
76 | 76 | records { |
77 | 77 | example.org. 60 IN MX 10 mx.example.org. |
78 | 78 | mx.example.org. 60 IN A 127.0.0.1 |
| 79 | + cname.example.org. 60 IN CNAME mx.example.org. |
| 80 | + dualstack.example.org. 60 IN A 127.0.0.1 |
| 81 | + dualstack.example.org. 60 IN AAAA ::1 |
| 82 | + cnameloop1.example.org. 60 IN CNAME cnameloop2.example.org. |
| 83 | + cnameloop2.example.org. 60 IN CNAME cnameloop1.example.org. |
| 84 | + cnameext.example.org. 60 IN CNAME mx.example.net. |
| 85 | +
|
| 86 | + cnamedepth.example.org. 60 IN CNAME cnamedepth1.example.org. |
| 87 | + cnamedepth1.example.org. 60 IN CNAME cnamedepth2.example.org. |
| 88 | + cnamedepth2.example.org. 60 IN CNAME cnamedepth3.example.org. |
| 89 | + cnamedepth3.example.org. 60 IN CNAME cnamedepth4.example.org. |
| 90 | + cnamedepth4.example.org. 60 IN CNAME cnamedepth5.example.org. |
| 91 | + cnamedepth5.example.org. 60 IN CNAME cnamedepth6.example.org. |
| 92 | + cnamedepth6.example.org. 60 IN CNAME cnamedepth7.example.org. |
| 93 | + cnamedepth7.example.org. 60 IN CNAME cnamedepth8.example.org. |
| 94 | + cnamedepth8.example.org. 60 IN CNAME cnamedepth9.example.org. |
| 95 | + cnamedepth9.example.org. 60 IN CNAME cnamedepth10.example.org. |
| 96 | + cnamedepth10.example.org. 60 IN CNAME cnamedepth11.example.org. |
| 97 | + cnamedepth11.example.org. 60 IN A 127.0.0.1 |
79 | 98 | } |
80 | 99 | ` |
81 | 100 |
|
@@ -122,6 +141,34 @@ var testCasesNoSOA = []test.Case{ |
122 | 141 | { |
123 | 142 | Qname: "mx.example.org.", Qtype: dns.TypeAAAA, |
124 | 143 | }, |
| 144 | + { |
| 145 | + Qname: "dualstack.example.org.", Qtype: dns.TypeANY, |
| 146 | + Answer: []dns.RR{ |
| 147 | + test.A("dualstack.example.org. 60 IN A 127.0.0.1"), |
| 148 | + test.AAAA("dualstack.example.org. 60 IN AAAA ::1"), |
| 149 | + }, |
| 150 | + }, |
| 151 | + { |
| 152 | + Qname: "cname.example.org.", Qtype: dns.TypeA, |
| 153 | + Answer: []dns.RR{ |
| 154 | + test.CNAME("cname.example.org. 60 IN CNAME mx.example.org."), |
| 155 | + test.A("mx.example.org. 60 IN A 127.0.0.1"), |
| 156 | + }, |
| 157 | + }, |
| 158 | + { |
| 159 | + Qname: "cnameext.example.org.", Qtype: dns.TypeA, |
| 160 | + Answer: []dns.RR{ |
| 161 | + test.CNAME("cnameext.example.org. 60 IN CNAME mx.example.net."), |
| 162 | + }, |
| 163 | + }, |
| 164 | + { |
| 165 | + Rcode: dns.RcodeServerFailure, |
| 166 | + Qname: "cnameloop1.example.org.", Qtype: dns.TypeA, |
| 167 | + }, |
| 168 | + { |
| 169 | + Rcode: dns.RcodeServerFailure, |
| 170 | + Qname: "cnamedepth.example.org.", Qtype: dns.TypeA, |
| 171 | + }, |
125 | 172 | } |
126 | 173 |
|
127 | 174 | func TestLookupMultipleOrigins(t *testing.T) { |
|
0 commit comments