feat: implement the unattended group (#183)
We don't want to run performance in the background because this causes too much traffic towards m-lab servers. When we'll have the check-in API, this will be the entry point we'll use to contact such an API and get things to do. Part of https://github.com/ooni/probe/issues/1289.
This commit is contained in:
parent
60d08eef3b
commit
d402cd9090
3 changed files with 50 additions and 51 deletions
|
|
@ -1,18 +1,20 @@
|
|||
package nettests
|
||||
|
||||
// NettestGroup base structure
|
||||
type NettestGroup struct {
|
||||
Label string
|
||||
Nettests []Nettest
|
||||
// Group is a group of nettests
|
||||
type Group struct {
|
||||
Label string
|
||||
Nettests []Nettest
|
||||
UnattendedOK bool
|
||||
}
|
||||
|
||||
// NettestGroups that can be run by the user
|
||||
var NettestGroups = map[string]NettestGroup{
|
||||
// All contains all the nettests that can be run by the user
|
||||
var All = map[string]Group{
|
||||
"websites": {
|
||||
Label: "Websites",
|
||||
Nettests: []Nettest{
|
||||
WebConnectivity{},
|
||||
},
|
||||
UnattendedOK: true,
|
||||
},
|
||||
"performance": {
|
||||
Label: "Performance",
|
||||
|
|
@ -27,6 +29,7 @@ var NettestGroups = map[string]NettestGroup{
|
|||
HTTPInvalidRequestLine{},
|
||||
HTTPHeaderFieldManipulation{},
|
||||
},
|
||||
UnattendedOK: true,
|
||||
},
|
||||
"im": {
|
||||
Label: "Instant Messaging",
|
||||
|
|
@ -35,6 +38,7 @@ var NettestGroups = map[string]NettestGroup{
|
|||
Telegram{},
|
||||
WhatsApp{},
|
||||
},
|
||||
UnattendedOK: true,
|
||||
},
|
||||
"circumvention": {
|
||||
Label: "Circumvention Tools",
|
||||
|
|
@ -42,5 +46,6 @@ var NettestGroups = map[string]NettestGroup{
|
|||
Psiphon{},
|
||||
Tor{},
|
||||
},
|
||||
UnattendedOK: true,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ func RunGroup(config RunGroupConfig) error {
|
|||
return err
|
||||
}
|
||||
|
||||
group, ok := NettestGroups[config.GroupName]
|
||||
group, ok := All[config.GroupName]
|
||||
if !ok {
|
||||
log.Errorf("No test group named %s", config.GroupName)
|
||||
return errors.New("invalid test group name")
|
||||
|
|
|
|||
Loading…
Reference in a new issue