feat: add a simple dnsping experiment (#674)

See https://github.com/ooni/probe/issues/1987 (issue).

See https://github.com/ooni/spec/pull/238 (impl).

While there, fix the build for go1.18 by adding go1.18 specific tests. I was
increasingly bothered by the build being red.
This commit is contained in:
Simone Basso 2022-05-09 15:28:18 +02:00 committed by GitHub
commit 36ca28d673
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 855 additions and 14 deletions

View file

@ -5,6 +5,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/engine/experiment/dash"
"github.com/ooni/probe-cli/v3/internal/engine/experiment/dnscheck"
"github.com/ooni/probe-cli/v3/internal/engine/experiment/dnsping"
"github.com/ooni/probe-cli/v3/internal/engine/experiment/example"
"github.com/ooni/probe-cli/v3/internal/engine/experiment/fbmessenger"
"github.com/ooni/probe-cli/v3/internal/engine/experiment/hhfm"
@ -57,6 +58,18 @@ var experimentsByName = map[string]func(*Session) *ExperimentBuilder{
}
},
"dnsping": func(session *Session) *ExperimentBuilder {
return &ExperimentBuilder{
build: func(config interface{}) *Experiment {
return NewExperiment(session, dnsping.NewExperimentMeasurer(
*config.(*dnsping.Config),
))
},
config: &dnsping.Config{},
inputPolicy: InputOrStaticDefault,
}
},
"example": func(session *Session) *ExperimentBuilder {
return &ExperimentBuilder{
build: func(config interface{}) *Experiment {