diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-11-21 16:52:40 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-11-22 12:07:57 +0100 |
| commit | 9da37ae85383e0dda5fc114ec808909f72fe038d (patch) | |
| tree | 9bcbf8942279f9210bdabcd5678cfc22a222588f | |
| parent | 1c8e10bcebe7f39ca238a5dfbd1bd92c9faa39b8 (diff) | |
dashboard: fix the broken AccessTest
The test config changes needed for the recent changes in incoming email
handling testing accidentally broke the AccessTest.
Fix this by introducing a separate test namespace for public email
testing.
| -rw-r--r-- | dashboard/app/app_test.go | 51 | ||||
| -rw-r--r-- | dashboard/app/email_test.go | 4 | ||||
| -rw-r--r-- | dashboard/app/util_test.go | 18 |
3 files changed, 47 insertions, 26 deletions
diff --git a/dashboard/app/app_test.go b/dashboard/app/app_test.go index 87baeaae4..55b3cad84 100644 --- a/dashboard/app/app_test.go +++ b/dashboard/app/app_test.go @@ -252,16 +252,35 @@ var testConfig = &GlobalConfig{ AccessLevel: AccessUser, Name: "access-user-reporting1", DailyLimit: 1000, - Config: &EmailConfig{ - Email: "test@syzkaller.com", - HandleListEmails: true, - }, + Config: &TestConfig{Index: 1}, }, { Name: "access-public-reporting2", DailyLimit: 1000, + Config: &TestConfig{Index: 2}, + }, + }, + }, + "access-public-email": { + AccessLevel: AccessPublic, + Key: "publickeypublickeypublickey", + Clients: map[string]string{ + clientPublicEmail: keyPublicEmail, + }, + Repos: []KernelRepo{ + { + URL: "git://syzkaller.org/access-public-email.git", + Branch: "access-public-email", + Alias: "access-public-email", + }, + }, + Reporting: []Reporting{ + { + AccessLevel: AccessPublic, + Name: "access-public-email-reporting1", + DailyLimit: 1000, Config: &EmailConfig{ - Email: "test2@syzkaller.com", + Email: "test@syzkaller.com", HandleListEmails: true, }, }, @@ -271,16 +290,18 @@ var testConfig = &GlobalConfig{ } const ( - client1 = "client1" - client2 = "client2" - password1 = "client1keyclient1keyclient1key" - password2 = "client2keyclient2keyclient2key" - clientAdmin = "client-admin" - keyAdmin = "clientadminkeyclientadminkey" - clientUser = "client-user" - keyUser = "clientuserkeyclientuserkey" - clientPublic = "client-public" - keyPublic = "clientpublickeyclientpublickey" + client1 = "client1" + client2 = "client2" + password1 = "client1keyclient1keyclient1key" + password2 = "client2keyclient2keyclient2key" + clientAdmin = "client-admin" + keyAdmin = "clientadminkeyclientadminkey" + clientUser = "client-user" + keyUser = "clientuserkeyclientuserkey" + clientPublic = "client-public" + keyPublic = "clientpublickeyclientpublickey" + clientPublicEmail = "client-public-email" + keyPublicEmail = "clientpublicemailkeyclientpublicemailkey" restrictedManager = "restricted-manager" noFixBisectionManager = "no-fix-bisection-manager" diff --git a/dashboard/app/email_test.go b/dashboard/app/email_test.go index c0003d2f0..78975bcbd 100644 --- a/dashboard/app/email_test.go +++ b/dashboard/app/email_test.go @@ -880,7 +880,7 @@ func TestBugFromSubjectInference(t *testing.T) { c := NewCtx(t) defer c.Close() - client := c.clientPublic + client := c.clientPublicEmail build := testBuild(1) client.UploadBuild(build) @@ -905,7 +905,7 @@ func TestBugFromSubjectInference(t *testing.T) { origSender := upstreamCrash(crashTitle) upstreamCrash("unrelated crash 2") - mailingList := "<" + config.Namespaces["access-public"].Reporting[1].Config.(*EmailConfig).Email + ">" + mailingList := "<" + config.Namespaces["access-public-email"].Reporting[0].Config.(*EmailConfig).Email + ">" // First try to ping some non-existing bug. subject := "Re: unknown-bug" diff --git a/dashboard/app/util_test.go b/dashboard/app/util_test.go index f5faba399..64bb92443 100644 --- a/dashboard/app/util_test.go +++ b/dashboard/app/util_test.go @@ -34,14 +34,14 @@ import ( ) type Ctx struct { - t *testing.T - inst aetest.Instance - ctx context.Context - mockedTime time.Time - emailSink chan *aemail.Message - client *apiClient - client2 *apiClient - clientPublic *apiClient + t *testing.T + inst aetest.Instance + ctx context.Context + mockedTime time.Time + emailSink chan *aemail.Message + client *apiClient + client2 *apiClient + clientPublicEmail *apiClient } var skipDevAppserverTests = func() bool { @@ -76,7 +76,7 @@ func NewCtx(t *testing.T) *Ctx { } c.client = c.makeClient(client1, password1, true) c.client2 = c.makeClient(client2, password2, true) - c.clientPublic = c.makeClient(clientPublic, keyPublic, true) + c.clientPublicEmail = c.makeClient(clientPublicEmail, keyPublicEmail, true) registerContext(r, c) return c } |
