feat(netxlite): implements NS queries (#734)
This diff has been extracted from eb0bf38957.
See https://github.com/ooni/probe/issues/2096.
While there, skip the broken tests caused by issue
https://github.com/ooni/probe/issues/2098.
This commit is contained in:
parent
c1b06a2d09
commit
ce052b665e
26 changed files with 859 additions and 75 deletions
|
|
@ -2,6 +2,7 @@ package mocks
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
|
||||
"github.com/ooni/probe-cli/v3/internal/model"
|
||||
)
|
||||
|
|
@ -13,6 +14,7 @@ type Resolver struct {
|
|||
MockAddress func() string
|
||||
MockCloseIdleConnections func()
|
||||
MockLookupHTTPS func(ctx context.Context, domain string) (*model.HTTPSSvc, error)
|
||||
MockLookupNS func(ctx context.Context, domain string) ([]*net.NS, error)
|
||||
}
|
||||
|
||||
// LookupHost calls MockLookupHost.
|
||||
|
|
@ -39,3 +41,8 @@ func (r *Resolver) CloseIdleConnections() {
|
|||
func (r *Resolver) LookupHTTPS(ctx context.Context, domain string) (*model.HTTPSSvc, error) {
|
||||
return r.MockLookupHTTPS(ctx, domain)
|
||||
}
|
||||
|
||||
// LookupNS calls MockLookupNS.
|
||||
func (r *Resolver) LookupNS(ctx context.Context, domain string) ([]*net.NS, error) {
|
||||
return r.MockLookupNS(ctx, domain)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue