aboutsummaryrefslogtreecommitdiffstats
path: root/syz-cluster/pkg/api
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-01-15 17:41:31 +0100
committerAleksandr Nogikh <nogikh@google.com>2025-01-22 13:17:53 +0000
commitcc143e38041972ad4dbaff9cfbfd416c29d581b5 (patch)
tree31e07572a22bebdc20c1fc73a6ef9140c03eb3e5 /syz-cluster/pkg/api
parent6bab9518e47d67b3c9bba00f213aa3e1637063e1 (diff)
syz-cluster: add support for findings
Findings are crashes and build/boot/test errors that happened during the patch series processing.
Diffstat (limited to 'syz-cluster/pkg/api')
-rw-r--r--syz-cluster/pkg/api/api.go21
-rw-r--r--syz-cluster/pkg/api/client.go5
2 files changed, 26 insertions, 0 deletions
diff --git a/syz-cluster/pkg/api/api.go b/syz-cluster/pkg/api/api.go
index ea629e534..510dd1c47 100644
--- a/syz-cluster/pkg/api/api.go
+++ b/syz-cluster/pkg/api/api.go
@@ -60,12 +60,33 @@ type Build struct {
BuildSuccess bool `json:"build_success"`
}
+const (
+ TestRunning string = "running"
+ TestPassed string = "passed"
+ TestFailed string = "failed" // TODO: drop it? only mark completion?
+ TestError string = "error"
+)
+
type TestResult struct {
SessionID string `json:"session_id"`
BaseBuildID string `json:"base_build_id"`
PatchedBuildID string `json:"patched_build_id"`
TestName string `json:"test_name"`
Result string `json:"result"`
+ Log []byte `json:"log"`
+}
+
+type BootResult struct {
+ Success bool `json:"success"`
+}
+
+// Finding is a kernel crash, boot error, etc. found during a test.
+type Finding struct {
+ SessionID string `json:"session_id"`
+ TestName string `json:"test_name"`
+ Title string `json:"title"`
+ Report []byte `json:"report"`
+ Log []byte `json:"log"`
}
// For now, there's no reason to obtain these really via a real API call.
diff --git a/syz-cluster/pkg/api/client.go b/syz-cluster/pkg/api/client.go
index 0d73d5d43..5f4121c9e 100644
--- a/syz-cluster/pkg/api/client.go
+++ b/syz-cluster/pkg/api/client.go
@@ -64,6 +64,11 @@ func (client Client) UploadTestResult(ctx context.Context, req *TestResult) erro
return err
}
+func (client Client) UploadFinding(ctx context.Context, req *Finding) error {
+ _, err := postJSON[Finding, any](ctx, client.baseURL+"/findings/upload", req)
+ return err
+}
+
func getJSON[Resp any](url string) (*Resp, error) {
resp, err := http.Get(url)
if err != nil {