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
parent 596bdf6e57
commit d3c5196474
19 changed files with 72 additions and 37 deletions
+2 -2
View File
@@ -364,9 +364,9 @@ type CheckInConfig struct {
// Platform is the mobile platform (e.g. "android")
Platform string
// RunType indicates whether this is an automated ("timed") run
// RunType indicates whether this is an automated (model.RunTypeTimed) run
// or otherwise a manual run initiated by the user.
RunType string
RunType model.RunType
// SoftwareName is the name of the application.
SoftwareName string
+5 -5
View File
@@ -259,7 +259,7 @@ func TestCheckInSuccess(t *testing.T) {
Charging: true,
OnWiFi: true,
Platform: "android",
RunType: "timed",
RunType: model.RunTypeTimed,
SoftwareName: "ooniprobe-android",
SoftwareVersion: "2.7.1",
WebConnectivity: &oonimkall.CheckInConfigWebConnectivity{},
@@ -307,7 +307,7 @@ func TestCheckInLookupLocationFailure(t *testing.T) {
Charging: true,
OnWiFi: true,
Platform: "android",
RunType: "timed",
RunType: model.RunTypeTimed,
SoftwareName: "ooniprobe-android",
SoftwareVersion: "2.7.1",
WebConnectivity: &oonimkall.CheckInConfigWebConnectivity{},
@@ -337,7 +337,7 @@ func TestCheckInNewProbeServicesFailure(t *testing.T) {
Charging: true,
OnWiFi: true,
Platform: "android",
RunType: "timed",
RunType: model.RunTypeTimed,
SoftwareName: "ooniprobe-android",
SoftwareVersion: "2.7.1",
WebConnectivity: &oonimkall.CheckInConfigWebConnectivity{},
@@ -366,7 +366,7 @@ func TestCheckInCheckInFailure(t *testing.T) {
Charging: true,
OnWiFi: true,
Platform: "android",
RunType: "timed",
RunType: model.RunTypeTimed,
SoftwareName: "ooniprobe-android",
SoftwareVersion: "2.7.1",
WebConnectivity: &oonimkall.CheckInConfigWebConnectivity{},
@@ -392,7 +392,7 @@ func TestCheckInNoParams(t *testing.T) {
Charging: true,
OnWiFi: true,
Platform: "android",
RunType: "timed",
RunType: model.RunTypeTimed,
SoftwareName: "ooniprobe-android",
SoftwareVersion: "2.7.1",
}