refactor: merge dnsx and errorsx into netxlite (#517)
When preparing a tutorial for netxlite, I figured it is easier to tell people "hey, this is the package you should use for all low-level networking stuff" rather than introducing people to a set of packages working together where some piece of functionality is here and some other piece is there. Part of https://github.com/ooni/probe/issues/1591
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/model"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite/errorsx"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -111,7 +111,7 @@ func (tk *TestKeys) ComputeEndpointStatus(v urlgetter.MultiOutput, dns, tcp **bo
|
||||
// start where all is unknown
|
||||
*dns, *tcp = nil, nil
|
||||
// process DNS first
|
||||
if v.TestKeys.FailedOperation != nil && *v.TestKeys.FailedOperation == errorsx.ResolveOperation {
|
||||
if v.TestKeys.FailedOperation != nil && *v.TestKeys.FailedOperation == netxlite.ResolveOperation {
|
||||
tk.FacebookDNSBlocking = &trueValue
|
||||
*dns = &falseValue
|
||||
return // we know that the DNS has failed
|
||||
@@ -127,7 +127,7 @@ func (tk *TestKeys) ComputeEndpointStatus(v urlgetter.MultiOutput, dns, tcp **bo
|
||||
}
|
||||
*dns = &trueValue
|
||||
// now process connect
|
||||
if v.TestKeys.FailedOperation != nil && *v.TestKeys.FailedOperation == errorsx.ConnectOperation {
|
||||
if v.TestKeys.FailedOperation != nil && *v.TestKeys.FailedOperation == netxlite.ConnectOperation {
|
||||
tk.FacebookTCPBlocking = &trueValue
|
||||
*tcp = &falseValue
|
||||
return // because connect failed
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/mockable"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/model"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/netx/archival"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite/errorsx"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite"
|
||||
)
|
||||
|
||||
func TestNewExperimentMeasurer(t *testing.T) {
|
||||
@@ -162,7 +162,7 @@ func TestWithCancelledContext(t *testing.T) {
|
||||
|
||||
func TestComputeEndpointStatsTCPBlocking(t *testing.T) {
|
||||
failure := io.EOF.Error()
|
||||
operation := errorsx.ConnectOperation
|
||||
operation := netxlite.ConnectOperation
|
||||
tk := fbmessenger.TestKeys{}
|
||||
tk.Update(urlgetter.MultiOutput{
|
||||
Input: urlgetter.MultiInput{Target: fbmessenger.ServiceEdge},
|
||||
@@ -192,7 +192,7 @@ func TestComputeEndpointStatsTCPBlocking(t *testing.T) {
|
||||
|
||||
func TestComputeEndpointStatsDNSIsLying(t *testing.T) {
|
||||
failure := io.EOF.Error()
|
||||
operation := errorsx.ConnectOperation
|
||||
operation := netxlite.ConnectOperation
|
||||
tk := fbmessenger.TestKeys{}
|
||||
tk.Update(urlgetter.MultiOutput{
|
||||
Input: urlgetter.MultiInput{Target: fbmessenger.ServiceEdge},
|
||||
|
||||
Reference in New Issue
Block a user