Skip to content

Commit

Permalink
Add PTR serve test
Browse files Browse the repository at this point in the history
  • Loading branch information
faide committed May 24, 2016
1 parent 4662ce4 commit 1da8743
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions serve_test.go
Expand Up @@ -130,6 +130,14 @@ func (s *ServeSuite) TestServing(c *C) {
r = exchange(c, "one.test.example.com.", dns.TypeA)
ip = r.Answer[0].(*dns.A).A
c.Check(ip.String(), Equals, "192.168.1.6")

// PTR
r = exchange(c, "2.1.168.192.IN-ADDR.ARPA.", dns.TypePTR)
c.Check(r.Answer, HasLen, 1)
// NOERROR for PTR request
c.Check(r.Rcode, Equals, dns.RcodeSuccess)
name := r.Answer[0].(*dns.PTR).Ptr
c.Check(name, Equals, "bar.example.com.")
}

func (s *ServeSuite) TestServingMixedCase(c *C) {
Expand Down

0 comments on commit 1da8743

Please sign in to comment.