mirror of
https://github.com/jwhited/wgsd.git
synced 2025-01-18 22:09:34 +08:00
add tests for nxdomain and servfail
This commit is contained in:
parent
ec2c1f34ad
commit
49e376d95c
13
wgsd_test.go
13
wgsd_test.go
@ -112,6 +112,19 @@ func TestWGSD(t *testing.T) {
|
|||||||
test.AAAA(fmt.Sprintf("%s.example.com. 0 IN AAAA %s", peer2b32, peer2.Endpoint.IP.String())),
|
test.AAAA(fmt.Sprintf("%s.example.com. 0 IN AAAA %s", peer2b32, peer2.Endpoint.IP.String())),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
test.Case{
|
||||||
|
Qname: "nxdomain.example.com.",
|
||||||
|
Qtype: dns.TypeAAAA,
|
||||||
|
Rcode: dns.RcodeNameError,
|
||||||
|
Ns: []dns.RR{
|
||||||
|
test.SOA(soa("example.com.").String()),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
test.Case{
|
||||||
|
Qname: "servfail.notexample.com.",
|
||||||
|
Qtype: dns.TypeAAAA,
|
||||||
|
Rcode: dns.RcodeServerFailure,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(fmt.Sprintf("%s %s", tc.Qname, dns.TypeToString[tc.Qtype]), func(t *testing.T) {
|
t.Run(fmt.Sprintf("%s %s", tc.Qname, dns.TypeToString[tc.Qtype]), func(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user