Use more general ooni/probe-engine API (#67)

No functional change, just importing less stuff and meddling
much less with the internals of ooni/probe-engine.
This commit is contained in:
Simone Basso 2019-10-28 14:05:05 +01:00 committed by GitHub
commit 946289d6fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 230 additions and 128 deletions

View file

@ -4,7 +4,6 @@ import (
"github.com/pkg/errors"
"github.com/ooni/probe-cli/nettests"
"github.com/ooni/probe-engine/experiment/dash"
)
// Dash test implementation
@ -13,10 +12,11 @@ type Dash struct {
// Run starts the test
func (d Dash) Run(ctl *nettests.Controller) error {
experiment := dash.NewExperiment(
ctl.Ctx.Session, dash.Config{},
)
return ctl.Run(experiment, []string{""})
builder, err := ctl.Ctx.Session.NewExperimentBuilder("dash")
if err != nil {
return err
}
return ctl.Run(builder, []string{""})
}
// DashTestKeys for the test

View file

@ -2,7 +2,6 @@ package performance
import (
"github.com/ooni/probe-cli/nettests"
"github.com/ooni/probe-engine/experiment/ndt"
"github.com/pkg/errors"
)
@ -12,10 +11,11 @@ type NDT struct {
// Run starts the test
func (n NDT) Run(ctl *nettests.Controller) error {
experiment := ndt.NewExperiment(
ctl.Ctx.Session, ndt.Config{},
)
return ctl.Run(experiment, []string{""})
builder, err := ctl.Ctx.Session.NewExperimentBuilder("ndt")
if err != nil {
return err
}
return ctl.Run(builder, []string{""})
}
// NDTTestKeys for the test