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

@ -2,7 +2,6 @@ package im
import (
"github.com/ooni/probe-cli/nettests"
"github.com/ooni/probe-engine/experiment/telegram"
)
// Telegram test implementation
@ -11,10 +10,16 @@ type Telegram struct {
// Run starts the test
func (h Telegram) Run(ctl *nettests.Controller) error {
experiment := telegram.NewExperiment(ctl.Ctx.Session, telegram.Config{
LogLevel: "INFO",
})
return ctl.Run(experiment, []string{""})
builder, err := ctl.Ctx.Session.NewExperimentBuilder(
"telegram",
)
if err != nil {
return err
}
if err := builder.SetOptionString("LogLevel", "INFO"); err != nil {
return err
}
return ctl.Run(builder, []string{""})
}
// TelegramTestKeys for the test