fix(netxlite): map servfail error (#728)
This error occurred for example when querying kazemjalali.com
in websteps measurements run from Iran.
This error is relatively uncommon, but it still makes sense to
create a specific mapping rule for it.
Originally: 4269e82fbd
See https://github.com/ooni/probe/issues/2096
This commit is contained in:
parent
b872dd0e1e
commit
5904e6988d
7 changed files with 34 additions and 3 deletions
|
|
@ -47,6 +47,18 @@ func TestDNSDecoder(t *testing.T) {
|
|||
}
|
||||
})
|
||||
|
||||
t.Run("Servfail", func(t *testing.T) {
|
||||
d := &DNSDecoderMiekg{}
|
||||
data, err := d.DecodeLookupHost(
|
||||
dns.TypeA, dnsGenReplyWithError(t, dns.TypeA, dns.RcodeServerFailure))
|
||||
if !errors.Is(err, ErrOODNSServfail) {
|
||||
t.Fatal("not the error we expected", err)
|
||||
}
|
||||
if data != nil {
|
||||
t.Fatal("expected nil data here")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("no address", func(t *testing.T) {
|
||||
d := &DNSDecoderMiekg{}
|
||||
data, err := d.DecodeLookupHost(dns.TypeA, dnsGenLookupHostReplySuccess(t, dns.TypeA))
|
||||
|
|
|
|||
Loading…
Reference in a new issue