From 2cfec537a35f8e7bcb50a3302d73bb98be70e426 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 31 Jan 2025 12:38:41 +0100 Subject: syz-cluster: store session test logs Record the logs from the build and fuzzing steps. --- syz-cluster/dashboard/handler.go | 12 ++++++++++++ syz-cluster/dashboard/main.go | 1 + syz-cluster/dashboard/templates/series.html | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'syz-cluster/dashboard') diff --git a/syz-cluster/dashboard/handler.go b/syz-cluster/dashboard/handler.go index f744a5ca9..33c838b85 100644 --- a/syz-cluster/dashboard/handler.go +++ b/syz-cluster/dashboard/handler.go @@ -187,6 +187,18 @@ func (h *dashboardHandler) findingInfo(w http.ResponseWriter, r *http.Request) { } } +func (h *dashboardHandler) sessionTestLog(w http.ResponseWriter, r *http.Request) { + test, err := h.sessionTestRepo.Get(r.Context(), r.PathValue("id"), r.FormValue("name")) + if err != nil { + http.Error(w, fmt.Sprint(err), http.StatusInternalServerError) + return + } else if test == nil { + http.Error(w, "there's no such test", http.StatusNotFound) + return + } + h.streamBlob(w, test.LogURI) +} + func (h *dashboardHandler) streamBlob(w http.ResponseWriter, uri string) { if uri == "" { return diff --git a/syz-cluster/dashboard/main.go b/syz-cluster/dashboard/main.go index 0497cc86b..064dd31da 100644 --- a/syz-cluster/dashboard/main.go +++ b/syz-cluster/dashboard/main.go @@ -27,6 +27,7 @@ func main() { app.Fatalf("failed to set up handler: %v", err) } http.HandleFunc("/sessions/{id}/log", handler.sessionLog) + http.HandleFunc("/sessions/{id}/test_logs", handler.sessionTestLog) http.HandleFunc("/series/{id}", handler.seriesInfo) http.HandleFunc("/patches/{id}", handler.patchContent) http.HandleFunc("/findings/{id}/{key}", handler.findingInfo) diff --git a/syz-cluster/dashboard/templates/series.html b/syz-cluster/dashboard/templates/series.html index adc10b8d2..042f9efba 100644 --- a/syz-cluster/dashboard/templates/series.html +++ b/syz-cluster/dashboard/templates/series.html @@ -117,7 +117,12 @@ {{.TestName}} {{if .BaseBuild}}{{.BaseBuild.CommitHash}}{{end}} {{if .PatchedBuild}}{{.PatchedBuild.CommitHash}}[patched]{{end}} - {{.Result}} + + {{.Result}} + {{if .LogURI}} + [Log] + {{end}} + {{if .Findings}} -- cgit mrf-deployment