aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-04-12 08:45:59 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-04-12 19:21:17 +0200
commit8d72091bf0f78d7fb78c08295cd9a7751cb1d8b4 (patch)
treeff8bd5a64e0c19e1eb7ccb04581c522ecd234651
parent5071aa3b90bf56d6c452aaf4c2199fcaeef5ed34 (diff)
dashboard: test boot errors
They don't have an explicit repro, but in fact we can easily test them, even without any changes to the testing code. Adjust #syz test request validation.
-rw-r--r--dashboard/app/jobs.go5
-rw-r--r--dashboard/app/jobs_test.go30
2 files changed, 34 insertions, 1 deletions
diff --git a/dashboard/app/jobs.go b/dashboard/app/jobs.go
index 797696043..1e1ff85bd 100644
--- a/dashboard/app/jobs.go
+++ b/dashboard/app/jobs.go
@@ -166,8 +166,11 @@ func addTestJob(c context.Context, bug *Bug, bugKey *db.Key, bugReporting *BugRe
func checkTestJob(c context.Context, bug *Bug, bugReporting *BugReporting, crash *Crash,
repo, branch string) string {
+ isBootError := func(crash *Crash) bool {
+ return strings.Contains(crash.Title, "boot error:")
+ }
switch {
- case crash.ReproC == 0 && crash.ReproSyz == 0:
+ case !isBootError(crash) && crash.ReproC == 0 && crash.ReproSyz == 0:
return "This crash does not have a reproducer. I cannot test it."
case !vcs.CheckRepoAddress(repo):
return fmt.Sprintf("%q does not look like a valid git repo address.", repo)
diff --git a/dashboard/app/jobs_test.go b/dashboard/app/jobs_test.go
index ebfa47fbe..fb2e4e878 100644
--- a/dashboard/app/jobs_test.go
+++ b/dashboard/app/jobs_test.go
@@ -275,6 +275,36 @@ Note: testing is done by a robot and is best-effort only.
c.expectEQ(pollResp.ID, "")
}
+// Test whether we can test boot time crashes.
+func TestJobBootError(t *testing.T) {
+ c := NewCtx(t)
+ defer c.Close()
+
+ build := testBuild(1)
+ c.client2.UploadBuild(build)
+
+ patch := `--- a/mm/kasan/kasan.c
++++ b/mm/kasan/kasan.c
+- current->kasan_depth++;
++ current->kasan_depth--;
+`
+
+ crash := testCrash(build, 2)
+ crash.Title = "riscv/fixes boot error: can't ssh into the instance"
+ c.client2.ReportCrash(crash)
+
+ sender := c.pollEmailBug().Sender
+ c.incomingEmail(sender, "#syz upstream\n")
+ sender = c.pollEmailBug().Sender
+ mailingList := config.Namespaces["test2"].Reporting[1].Config.(*EmailConfig).Email
+
+ c.incomingEmail(sender, "#syz test: git://git.git/git.git kernel-branch\n"+patch,
+ EmailOptFrom("test@requester.com"), EmailOptCC([]string{mailingList}))
+ c.expectNoEmail()
+ pollResp := c.client2.pollJobs(build.Manager)
+ c.expectEQ(pollResp.Type, dashapi.JobTestPatch)
+}
+
// Test on particular commit and without a patch.
func TestJobWithoutPatch(t *testing.T) {
c := NewCtx(t)