diff --git a/e2etests/orchestration/common.go b/e2etests/orchestration/common.go index 42ec6d05d4..ef0c2360bb 100644 --- a/e2etests/orchestration/common.go +++ b/e2etests/orchestration/common.go @@ -213,3 +213,22 @@ func verifyZipFile(filename string) error { } return nil } + +func VerifyLogsEndpoint(srvURL, group, name string) error { + base := fmt.Sprintf("%s/cvds/%s/%s/logs/", srvURL, group, name) + urls := []string{ + base, + base + "launcher.log", + base + "kernel.log", + } + for _, v := range urls { + res, err := http.Get(v) + if err != nil { + return err + } + if res.StatusCode != http.StatusOK { + return fmt.Errorf("get %q failed with status code: %d", v, res.StatusCode) + } + } + return nil +} diff --git a/e2etests/orchestration/createlocalimage_test.go b/e2etests/orchestration/createlocalimage_test.go index 2591624dde..209065fd6e 100644 --- a/e2etests/orchestration/createlocalimage_test.go +++ b/e2etests/orchestration/createlocalimage_test.go @@ -90,6 +90,9 @@ func TestInstance(t *testing.T) { if createErr != nil { t.Fatal(err) } + if err := e2etesting.VerifyLogsEndpoint(ctx.ServiceURL, group_name, "1"); err != nil { + t.Fatalf("failed verifying /logs endpoint: %s", err) + } want := &hoapi.CreateCVDResponse{ CVDs: []*hoapi.CVD{ &hoapi.CVD{ diff --git a/e2etests/orchestration/createsingleinstance_test.go b/e2etests/orchestration/createsingleinstance_test.go index 790456b6a0..6b1bd31a53 100644 --- a/e2etests/orchestration/createsingleinstance_test.go +++ b/e2etests/orchestration/createsingleinstance_test.go @@ -57,6 +57,9 @@ func TestCreateSingleInstance(t *testing.T) { if createErr != nil { t.Fatal(err) } + if err := e2etesting.VerifyLogsEndpoint(ctx.ServiceURL, "cvd", "1"); err != nil { + t.Fatalf("failed verifying /logs endpoint: %s", err) + } want := &hoapi.CreateCVDResponse{ CVDs: []*hoapi.CVD{ &hoapi.CVD{