diff --git a/internal/cli/run/run.go b/internal/cli/run/run.go index 47333ff..e88a483 100644 --- a/internal/cli/run/run.go +++ b/internal/cli/run/run.go @@ -26,6 +26,8 @@ func init() { fmt.Sprintf("the nettest group to run. Supported tests are: %s", strings.Join(nettestGroupNames, ", "))).Required().String() + noCollector := cmd.Flag("no-collector", "Disable uploading measurements to a collector").Bool() + cmd.Action(func(_ *kingpin.ParseContext) error { log.Infof("Starting %s", *nettestGroup) ctx, err := root.Init() @@ -39,6 +41,10 @@ func init() { return err } + if *noCollector == true { + ctx.Config.Sharing.UploadResults = false + } + group, ok := groups.NettestGroups[*nettestGroup] if !ok { log.Errorf("No test group named %s", *nettestGroup) diff --git a/nettests/nettests.go b/nettests/nettests.go index e02caaf..730ad0f 100644 --- a/nettests/nettests.go +++ b/nettests/nettests.go @@ -128,7 +128,7 @@ func (c *Controller) Init(nt *mk.Nettest) error { ProbeIP: c.Ctx.Location.IP, 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 SoftwareName: "ooniprobe", SoftwareVersion: ooni.Version,