Fix test failures introduced by previous commit afd1fe21f6.

This commit is contained in:
Eugene Bujak 2018-09-25 19:12:32 +03:00
parent afd1fe21f6
commit ea320f5ee3
1 changed files with 6 additions and 1 deletions

View File

@ -126,7 +126,12 @@ func TestEtcHostsFilter(t *testing.T) {
if rcode != rrw.Rcode {
t.Fatalf("ServeDNS return value for host %s has rcode %d that does not match captured rcode %d", testcase.host, rcode, rrw.Rcode)
}
filtered := rcode == dns.RcodeNameError
A, ok := rrw.Msg.Answer[0].(*dns.A)
if !ok {
t.Fatalf("Host %s expected to have result A", testcase.host)
}
ip := net.IPv4(127, 0, 0, 1)
filtered := ip.Equal(A.A)
if testcase.filtered && testcase.filtered != filtered {
t.Fatalf("Host %s expected to be filtered, instead it is not filtered", testcase.host)
}