From 49e376d95c4b578c95e48031a3cb0a91ce33866b Mon Sep 17 00:00:00 2001 From: Jordan Whited Date: Thu, 28 May 2020 19:46:24 -0700 Subject: [PATCH] add tests for nxdomain and servfail --- wgsd_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wgsd_test.go b/wgsd_test.go index a8124fd..88aea11 100644 --- a/wgsd_test.go +++ b/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.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 { t.Run(fmt.Sprintf("%s %s", tc.Qname, dns.TypeToString[tc.Qtype]), func(t *testing.T) {