Make it possible to disable uploading of results
This commit is contained in:
parent
867204adfb
commit
5cae6b0b83
|
@ -26,6 +26,8 @@ func init() {
|
||||||
fmt.Sprintf("the nettest group to run. Supported tests are: %s",
|
fmt.Sprintf("the nettest group to run. Supported tests are: %s",
|
||||||
strings.Join(nettestGroupNames, ", "))).Required().String()
|
strings.Join(nettestGroupNames, ", "))).Required().String()
|
||||||
|
|
||||||
|
noCollector := cmd.Flag("no-collector", "Disable uploading measurements to a collector").Bool()
|
||||||
|
|
||||||
cmd.Action(func(_ *kingpin.ParseContext) error {
|
cmd.Action(func(_ *kingpin.ParseContext) error {
|
||||||
log.Infof("Starting %s", *nettestGroup)
|
log.Infof("Starting %s", *nettestGroup)
|
||||||
ctx, err := root.Init()
|
ctx, err := root.Init()
|
||||||
|
@ -39,6 +41,10 @@ func init() {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *noCollector == true {
|
||||||
|
ctx.Config.Sharing.UploadResults = false
|
||||||
|
}
|
||||||
|
|
||||||
group, ok := groups.NettestGroups[*nettestGroup]
|
group, ok := groups.NettestGroups[*nettestGroup]
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Errorf("No test group named %s", *nettestGroup)
|
log.Errorf("No test group named %s", *nettestGroup)
|
||||||
|
|
|
@ -128,7 +128,7 @@ func (c *Controller) Init(nt *mk.Nettest) error {
|
||||||
ProbeIP: c.Ctx.Location.IP,
|
ProbeIP: c.Ctx.Location.IP,
|
||||||
|
|
||||||
DisableReportFile: false,
|
DisableReportFile: false,
|
||||||
DisableCollector: false,
|
DisableCollector: !c.Ctx.Config.Sharing.UploadResults,
|
||||||
RandomizeInput: false, // It's important to disable input randomization to ensure the URLs are written in sync to the DB
|
RandomizeInput: false, // It's important to disable input randomization to ensure the URLs are written in sync to the DB
|
||||||
SoftwareName: "ooniprobe",
|
SoftwareName: "ooniprobe",
|
||||||
SoftwareVersion: ooni.Version,
|
SoftwareVersion: ooni.Version,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user