Get NDT test to run via gooni
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package groups
|
||||
|
||||
import (
|
||||
"github.com/apex/log"
|
||||
ooni "github.com/openobservatory/gooni"
|
||||
"github.com/openobservatory/gooni/nettests"
|
||||
"github.com/openobservatory/gooni/nettests/performance"
|
||||
"github.com/openobservatory/gooni/nettests/websites"
|
||||
)
|
||||
|
||||
@@ -14,8 +17,10 @@ var NettestGroups = map[string]nettests.NettestGroup{
|
||||
},
|
||||
},
|
||||
"performance": nettests.NettestGroup{
|
||||
Label: "Performance",
|
||||
Nettests: []nettests.Nettest{},
|
||||
Label: "Performance",
|
||||
Nettests: []nettests.Nettest{
|
||||
performance.NDT{},
|
||||
},
|
||||
},
|
||||
"middleboxes": nettests.NettestGroup{
|
||||
Label: "Middleboxes",
|
||||
@@ -26,3 +31,15 @@ var NettestGroups = map[string]nettests.NettestGroup{
|
||||
Nettests: []nettests.Nettest{},
|
||||
},
|
||||
}
|
||||
|
||||
// Run runs a specific test group
|
||||
func Run(name string, ctx *ooni.Context) error {
|
||||
group := NettestGroups[name]
|
||||
log.Debugf("Running test group %s", group.Label)
|
||||
|
||||
for _, nt := range group.Nettests {
|
||||
ctl := nettests.NewController(ctx)
|
||||
nt.Run(ctl)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user