-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
probeservices, oonimkall: implement checkin api (#1158)
* First draft of checkin API * Correcting names * Tests * Update probeservices/checkin.go Co-authored-by: Simone Basso <[email protected]> * Update model/checkininfo.go Co-authored-by: Simone Basso <[email protected]> * Update probeservices/checkin_test.go Co-authored-by: Simone Basso <[email protected]> * Update probeservices/checkin.go Co-authored-by: Simone Basso <[email protected]> * check for result.WebConnectivity == nil * adding ReportID * Adding parameters * Fix parameters * comment * Start implementing the wrapper * Update session.go * Adding integration tests * fix: enforce GC and sleep for more time * format * fix(session.go): use the correct probe ASN * fix: message format and testing * fix(oonimkall): add one more test case Co-authored-by: Simone Basso <[email protected]>
- Loading branch information
1 parent
87c73c8
commit 36624ab
Showing
8 changed files
with
421 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package model | ||
|
||
// CheckInConfigWebConnectivity is the configuration for the WebConnectivity test | ||
type CheckInConfigWebConnectivity struct { | ||
CategoryCodes []string `json:"category_codes"` // CategoryCodes is an array of category codes | ||
} | ||
|
||
// CheckInConfig contains configuration for calling the checkin API. | ||
type CheckInConfig struct { | ||
Charging bool `json:"charging"` // Charging indicate if the phone is actually charging | ||
OnWiFi bool `json:"on_wifi"` // OnWiFi indicate if the phone is actually connected to a WiFi network | ||
Platform string `json:"platform"` // Platform of the probe | ||
ProbeASN string `json:"probe_asn"` // ProbeASN is the probe country code | ||
ProbeCC string `json:"probe_cc"` // ProbeCC is the probe country code | ||
RunType string `json:"run_type"` // RunType | ||
SoftwareName string `json:"software_name"` // SoftwareName of the probe | ||
SoftwareVersion string `json:"software_version"` // SoftwareVersion of the probe | ||
WebConnectivity CheckInConfigWebConnectivity `json:"web_connectivity"` // WebConnectivity class contain an array of categories | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package model | ||
|
||
// CheckInInfoWebConnectivity contains the array of URLs returned by the checkin API | ||
type CheckInInfoWebConnectivity struct { | ||
ReportID string `json:"report_id"` | ||
URLs []URLInfo `json:"urls"` | ||
} | ||
|
||
// CheckInInfo contains the return test objects from the checkin API | ||
type CheckInInfo struct { | ||
WebConnectivity *CheckInInfoWebConnectivity `json:"web_connectivity"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package oonimkall | ||
|
||
import "testing" | ||
|
||
func TestNewCheckInInfoWebConnectivityNilPointer(t *testing.T) { | ||
out := newCheckInInfoWebConnectivity(nil) | ||
if out != nil { | ||
t.Fatal("expected nil pointer") | ||
} | ||
} |
Oops, something went wrong.