Add remote test

TODO: hide this behind a -net tag, so it can be disabled.
This commit is contained in:
Miek Gieben 2015-08-22 10:50:07 +01:00
parent 5d1ea41bf6
commit 6f68c4c4bd
1 changed files with 19 additions and 0 deletions

19
remote_test.go Normal file
View File

@ -0,0 +1,19 @@
package dns
import "testing"
const LinodeAddr = "176.58.119.54:53"
func TestClientRemote(t *testing.T) {
m := new(Msg)
m.SetQuestion("go.dns.miek.nl.", TypeTXT)
c := new(Client)
r, _, err := c.Exchange(m, LinodeAddr)
if err != nil {
t.Errorf("failed to exchange: %v", err)
}
if r != nil && r.Rcode != RcodeSuccess {
t.Errorf("failed to get an valid answer\n%v", r)
}
}