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 (
"errors"
"github.com/ooni/probe-cli/nettests"
"github.com/ooni/probe-engine/experiment/hhfm"
)
// HTTPHeaderFieldManipulation test implementation
@ -13,10 +12,16 @@ type HTTPHeaderFieldManipulation struct {
// Run starts the test
func (h HTTPHeaderFieldManipulation) Run(ctl *nettests.Controller) error {
experiment := hhfm.NewExperiment(ctl.Ctx.Session, hhfm.Config{
LogLevel: "INFO",
})
return ctl.Run(experiment, []string{""})
builder, err := ctl.Ctx.Session.NewExperimentBuilder(
"http_header_field_manipulation",
)
if err != nil {
return err
}
if err := builder.SetOptionString("LogLevel", "INFO"); err != nil {
return err
}
return ctl.Run(builder, []string{""})
}
// HTTPHeaderFieldManipulationTestKeys for the test

View file

@ -4,7 +4,6 @@ import (
"errors"
"github.com/ooni/probe-cli/nettests"
"github.com/ooni/probe-engine/experiment/hirl"
)
// HTTPInvalidRequestLine test implementation
@ -13,10 +12,16 @@ type HTTPInvalidRequestLine struct {
// Run starts the test
func (h HTTPInvalidRequestLine) Run(ctl *nettests.Controller) error {
experiment := hirl.NewExperiment(ctl.Ctx.Session, hirl.Config{
LogLevel: "INFO",
})
return ctl.Run(experiment, []string{""})
builder, err := ctl.Ctx.Session.NewExperimentBuilder(
"http_invalid_request_line",
)
if err != nil {
return err
}
if err := builder.SetOptionString("LogLevel", "INFO"); err != nil {
return err
}
return ctl.Run(builder, []string{""})
}
// HTTPInvalidRequestLineTestKeys for the test