feat(ooniprobe): add torsf to experimental group (#670)
Reference issue: https://github.com/ooni/probe/issues/1917. I needed to change the summary key type returned by `torsf` to be a value. It seems the DB layer assumes that. If we pass it a pointer, it panics because it's experiment a value rather than a pointer 🤷.
This commit is contained in:
parent
97d2b5a0e3
commit
a01f901e13
|
@ -55,6 +55,7 @@ var All = map[string]Group{
|
||||||
Nettests: []Nettest{
|
Nettests: []Nettest{
|
||||||
DNSCheck{},
|
DNSCheck{},
|
||||||
STUNReachability{},
|
STUNReachability{},
|
||||||
|
TorSf{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
14
cmd/ooniprobe/internal/nettests/torsf.go
Normal file
14
cmd/ooniprobe/internal/nettests/torsf.go
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package nettests
|
||||||
|
|
||||||
|
// TorSf test implementation
|
||||||
|
type TorSf struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run starts the test
|
||||||
|
func (h TorSf) Run(ctl *Controller) error {
|
||||||
|
builder, err := ctl.Session.NewExperimentBuilder("torsf")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return ctl.Run(builder, []string{""})
|
||||||
|
}
|
|
@ -173,5 +173,5 @@ type SummaryKeys struct {
|
||||||
|
|
||||||
// GetSummaryKeys implements model.ExperimentMeasurer.GetSummaryKeys.
|
// GetSummaryKeys implements model.ExperimentMeasurer.GetSummaryKeys.
|
||||||
func (m *Measurer) GetSummaryKeys(measurement *model.Measurement) (interface{}, error) {
|
func (m *Measurer) GetSummaryKeys(measurement *model.Measurement) (interface{}, error) {
|
||||||
return &SummaryKeys{IsAnomaly: false}, nil
|
return SummaryKeys{IsAnomaly: false}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ func TestGetSummaryKeys(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
rsk := sk.(*SummaryKeys)
|
rsk := sk.(SummaryKeys)
|
||||||
if rsk.IsAnomaly {
|
if rsk.IsAnomaly {
|
||||||
t.Fatal("expected no anomaly here")
|
t.Fatal("expected no anomaly here")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user