Get NDT test to run via gooni

This commit is contained in:
Arturo Filastò
2018-02-13 17:16:23 +02:00
parent 7cf5bd2718
commit d3d3ce9d78
9 changed files with 122 additions and 25 deletions
+19 -2
View File
@@ -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
}