From 55a459b61c0d2b861d36d3a5146f48d7a71b9c62 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 6 Jul 2011 08:51:51 +0200 Subject: [PATCH] add edns0 test --- TODO | 3 --- client_test.go | 26 ++++++++++---------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/TODO b/TODO index 4c46c688..78f19225 100644 --- a/TODO +++ b/TODO @@ -4,9 +4,6 @@ Issues: * Make the testsuite work with public DNS servers * pack/Unpack smaller. EDNS 'n stuff can be folded in??? * Compression. Take stuff from Jan Mercl -o Tsig will probably become an interface which has all configuration - stuff, but this will come later. Config which has Tsig function - -- get TSIG working in xfrprx and see how that impact the package. XfrWriter diff --git a/client_test.go b/client_test.go index 64b55142..f4b17380 100644 --- a/client_test.go +++ b/client_test.go @@ -19,7 +19,6 @@ func TestClientSync(t *testing.T) { } } - func helloMiek(w RequestWriter, r *Msg) { w.Send(r) reply, _ := w.Receive() @@ -50,12 +49,10 @@ forever: } } -// TestClientEDNS -/* -func TestResolverEdns(t *testing.T) { +func TestClientEDNS0(t *testing.T) { + m := new(Msg) + m.SetQuestion("miek.nl", TypeDNSKEY) - - // Add EDNS rr edns := new(RR_OPT) edns.Hdr.Name = "." // must . be for edns edns.Hdr.Rrtype = TypeOPT @@ -66,21 +63,18 @@ func TestResolverEdns(t *testing.T) { edns.Option = make([]Option, 1) edns.SetNsid("") // Empty to request it - // ask something - m.Question[0] = Question{"powerdns.nl", TypeDNSKEY, ClassINET} m.Extra = make([]RR, 1) m.Extra[0] = edns - in, _ := res.Query(m) - if in != nil { - if in.Rcode != RcodeSuccess { - t.Logf("%v\n", in) - t.Log("Failed to get an valid answer") - t.Fail() - } + c := NewClient() + r := c.Exchange(m, "85.223.71.124:53") + + if r != nil && r.Rcode != RcodeSuccess { + t.Log("Failed to get an valid answer") + t.Fail() + t.Logf("%v\n", r) } } -*/ func TestClientTsigAXFR(t *testing.T) { m := new(Msg)