diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-01-16 13:32:39 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-01-16 13:37:14 +0100 |
| commit | afcb994770d7e0f4b88c623bec76fbdce57d3910 (patch) | |
| tree | b7316a776f954a49adee84094cf7358852266c33 /dashboard | |
| parent | 9aaf64b3742d1d4f744e22cad567906cebb201a2 (diff) | |
dashboard/app: rename attachments so they are sent as text/plain
Appengine sends only .txt/.diff files as text/plain.
Unknown extensions are send as application/octet-stream,
which is unacceptable.
I've opened a bug on appengine, but for now just rename them.
Diffstat (limited to 'dashboard')
| -rw-r--r-- | dashboard/app/email_test.go | 16 | ||||
| -rw-r--r-- | dashboard/app/jobs_test.go | 8 | ||||
| -rw-r--r-- | dashboard/app/reporting_email.go | 8 |
3 files changed, 16 insertions, 16 deletions
diff --git a/dashboard/app/email_test.go b/dashboard/app/email_test.go index 084846537..3de96639c 100644 --- a/dashboard/app/email_test.go +++ b/dashboard/app/email_test.go @@ -45,7 +45,7 @@ func TestEmailReport(t *testing.T) { c.expectEQ(len(msg.Attachments), 2) c.expectEQ(msg.Attachments[0].Name, "config.txt") c.expectEQ(msg.Attachments[0].Data, build.KernelConfig) - c.expectEQ(msg.Attachments[1].Name, "raw.log") + c.expectEQ(msg.Attachments[1].Name, "raw.log.txt") c.expectEQ(msg.Attachments[1].Data, crash.Log) body := fmt.Sprintf(`Hello, @@ -148,9 +148,9 @@ For more options, visit https://groups.google.com/d/optout. c.expectEQ(len(msg.Attachments), 3) c.expectEQ(msg.Attachments[0].Name, "config.txt") c.expectEQ(msg.Attachments[0].Data, build.KernelConfig) - c.expectEQ(msg.Attachments[1].Name, "raw.log") + c.expectEQ(msg.Attachments[1].Name, "raw.log.txt") c.expectEQ(msg.Attachments[1].Data, crash.Log) - c.expectEQ(msg.Attachments[2].Name, "repro.txt") + c.expectEQ(msg.Attachments[2].Name, "repro.syz.txt") c.expectEQ(msg.Attachments[2].Data, syzRepro) c.expectEQ(msg.Headers["In-Reply-To"], []string{"<1234>"}) body := fmt.Sprintf(`syzkaller has found reproducer for the following crash on kernel_commit1 @@ -196,9 +196,9 @@ report1 c.expectEQ(len(msg.Attachments), 3) c.expectEQ(msg.Attachments[0].Name, "config.txt") c.expectEQ(msg.Attachments[0].Data, build.KernelConfig) - c.expectEQ(msg.Attachments[1].Name, "raw.log") + c.expectEQ(msg.Attachments[1].Name, "raw.log.txt") c.expectEQ(msg.Attachments[1].Data, crash.Log) - c.expectEQ(msg.Attachments[2].Name, "repro.txt") + c.expectEQ(msg.Attachments[2].Name, "repro.syz.txt") c.expectEQ(msg.Attachments[2].Data, syzRepro) body := fmt.Sprintf(`Hello, @@ -277,11 +277,11 @@ Content-Type: text/plain c.expectEQ(len(msg.Attachments), 4) c.expectEQ(msg.Attachments[0].Name, "config.txt") c.expectEQ(msg.Attachments[0].Data, build.KernelConfig) - c.expectEQ(msg.Attachments[1].Name, "raw.log") + c.expectEQ(msg.Attachments[1].Name, "raw.log.txt") c.expectEQ(msg.Attachments[1].Data, crash.Log) - c.expectEQ(msg.Attachments[2].Name, "repro.txt") + c.expectEQ(msg.Attachments[2].Name, "repro.syz.txt") c.expectEQ(msg.Attachments[2].Data, syzRepro) - c.expectEQ(msg.Attachments[3].Name, "repro.c") + c.expectEQ(msg.Attachments[3].Name, "repro.c.txt") c.expectEQ(msg.Attachments[3].Data, crash.ReproC) body := fmt.Sprintf(`syzkaller has found reproducer for the following crash on kernel_commit1 repo1/branch1 diff --git a/dashboard/app/jobs_test.go b/dashboard/app/jobs_test.go index a1b164513..f1eacc408 100644 --- a/dashboard/app/jobs_test.go +++ b/dashboard/app/jobs_test.go @@ -112,9 +112,9 @@ func TestJob(t *testing.T) { c.expectEQ(len(msg.Attachments), 3) c.expectEQ(msg.Attachments[0].Name, "config.txt") c.expectEQ(msg.Attachments[0].Data, build.KernelConfig) - c.expectEQ(msg.Attachments[1].Name, "patch.txt") + c.expectEQ(msg.Attachments[1].Name, "patch.diff") c.expectEQ(msg.Attachments[1].Data, []byte(patch)) - c.expectEQ(msg.Attachments[2].Name, "raw.log") + c.expectEQ(msg.Attachments[2].Name, "raw.log.txt") c.expectEQ(msg.Attachments[2].Data, jobDoneReq.CrashLog) body := `Hello, @@ -150,7 +150,7 @@ Raw console output is attached. c.expectEQ(len(msg.Attachments), 2) c.expectEQ(msg.Attachments[0].Name, "config.txt") c.expectEQ(msg.Attachments[0].Data, build.KernelConfig) - c.expectEQ(msg.Attachments[1].Name, "patch.txt") + c.expectEQ(msg.Attachments[1].Name, "patch.diff") c.expectEQ(msg.Attachments[1].Data, []byte(patch)) body := `Hello, @@ -186,7 +186,7 @@ Kernel config is attached. c.expectEQ(len(msg.Attachments), 2) c.expectEQ(msg.Attachments[0].Name, "config.txt") c.expectEQ(msg.Attachments[0].Data, build.KernelConfig) - c.expectEQ(msg.Attachments[1].Name, "patch.txt") + c.expectEQ(msg.Attachments[1].Name, "patch.diff") c.expectEQ(msg.Attachments[1].Data, []byte(patch)) body := fmt.Sprintf(`Hello, diff --git a/dashboard/app/reporting_email.go b/dashboard/app/reporting_email.go index fddd14298..762a903b6 100644 --- a/dashboard/app/reporting_email.go +++ b/dashboard/app/reporting_email.go @@ -150,25 +150,25 @@ func emailReport(c context.Context, rep *dashapi.BugReport, templ string) error } if len(rep.Patch) != 0 { attachments = append(attachments, aemail.Attachment{ - Name: "patch.txt", + Name: "patch.diff", Data: rep.Patch, }) } if len(rep.Log) != 0 { attachments = append(attachments, aemail.Attachment{ - Name: "raw.log", + Name: "raw.log.txt", Data: rep.Log, }) } if len(rep.ReproSyz) != 0 { attachments = append(attachments, aemail.Attachment{ - Name: "repro.txt", + Name: "repro.syz.txt", Data: rep.ReproSyz, }) } if len(rep.ReproC) != 0 { attachments = append(attachments, aemail.Attachment{ - Name: "repro.c", + Name: "repro.c.txt", Data: rep.ReproC, }) } |
