fix(ooniprobe): use ooniprobe-cli-unattended for unattended runs (#714)

This diff changes the software name used by unattended runs for which
we did not override the default software name (`ooniprobe-cli`).

It will become `ooniprobe-cli-unattended`. This software name is in line
with the one we use for Android, iOS, and desktop unattended runs.

While working in this diff, I introduced string constants for the run
types and a string constant for the default software name.

See https://github.com/ooni/probe/issues/2081.
This commit is contained in:
Simone Basso 2022-04-29 13:41:09 +02:00 committed by GitHub
commit d3c5196474
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 72 additions and 37 deletions

View file

@ -1,5 +1,7 @@
package apimodel
import "github.com/ooni/probe-cli/v3/internal/model"
// CheckInRequestWebConnectivity contains WebConnectivity
// specific parameters to include into CheckInRequest
type CheckInRequestWebConnectivity struct {
@ -13,7 +15,7 @@ type CheckInRequest struct {
Platform string `json:"platform"`
ProbeASN string `json:"probe_asn"`
ProbeCC string `json:"probe_cc"`
RunType string `json:"run_type"`
RunType model.RunType `json:"run_type"`
SoftwareName string `json:"software_name"`
SoftwareVersion string `json:"software_version"`
WebConnectivity CheckInRequestWebConnectivity `json:"web_connectivity"`

View file

@ -6,6 +6,7 @@ import (
"log"
"github.com/ooni/probe-cli/v3/internal/kvstore"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/ooapi"
"github.com/ooni/probe-cli/v3/internal/ooapi/apimodel"
)
@ -21,7 +22,7 @@ func ExampleClient() {
Platform: "linux",
ProbeASN: "AS30722",
ProbeCC: "IT",
RunType: "timed",
RunType: model.RunTypeTimed,
SoftwareName: "miniooni",
SoftwareVersion: "0.1.0-dev",
WebConnectivity: apimodel.CheckInRequestWebConnectivity{

View file

@ -5,6 +5,7 @@ import (
"testing"
"github.com/ooni/probe-cli/v3/internal/kvstore"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/ooapi"
"github.com/ooni/probe-cli/v3/internal/ooapi/apimodel"
)
@ -19,7 +20,7 @@ func TestWithRealServerDoCheckIn(t *testing.T) {
Platform: "android",
ProbeASN: "AS12353",
ProbeCC: "IT",
RunType: "timed",
RunType: model.RunTypeTimed,
SoftwareName: "ooniprobe-android",
SoftwareVersion: "2.7.1",
WebConnectivity: apimodel.CheckInRequestWebConnectivity{