Fiexes for DNS tests

This commit is contained in:
Joona Hoikkala 2016-11-28 02:09:01 +02:00
parent 91ca768b5c
commit e036c191e9
No known key found for this signature in database
GPG Key ID: C14AAE0F5ADCB854

View File

@ -14,6 +14,7 @@ var server *dns.Server
var records = []string{ var records = []string{
"auth.example.org. A 192.168.1.100", "auth.example.org. A 192.168.1.100",
"ns1.auth.example.org. A 192.168.1.101", "ns1.auth.example.org. A 192.168.1.101",
"!''b', unparseable ",
"ns2.auth.example.org. A 192.168.1.102", "ns2.auth.example.org. A 192.168.1.102",
} }
@ -89,6 +90,11 @@ func TestResolveA(t *testing.T) {
} else { } else {
t.Error("No answer for DNS query") t.Error("No answer for DNS query")
} }
_, err = resolv.lookup("nonexistent.domain.tld", dns.TypeA)
if err == nil {
t.Errorf("Was expecting error because of NXDOMAIN but got none")
}
} }
func TestResolveTXT(t *testing.T) { func TestResolveTXT(t *testing.T) {