diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-04-08 09:06:49 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-04-13 04:14:16 +0300 |
commit | 34e1518038a8164c090ccfbfc30ebc7850e62cf0 (patch) | |
tree | 7cc8b5eb8c9b1c18eb106d7bd274f50a99d51f01 /test/acceptance/zip_test.go | |
parent | bda06683de6d93aeaff8d3c7357983ed7f0ccfc7 (diff) |
Allow serving zip from disk in chroot
This is a temporary workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/326117#note_546346101
where daemon-inplace-chroot=true fails to serve zip archives when pages_serve_with_zip_file_protocol is enabled
To be removed after we roll-out zip architecture completely https://gitlab.com/gitlab-org/gitlab-pages/-/issues/561
Changelog: fixed
Diffstat (limited to 'test/acceptance/zip_test.go')
-rw-r--r-- | test/acceptance/zip_test.go | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/test/acceptance/zip_test.go b/test/acceptance/zip_test.go index a7e82d27..008ccc4b 100644 --- a/test/acceptance/zip_test.go +++ b/test/acceptance/zip_test.go @@ -107,8 +107,6 @@ func TestZipServing(t *testing.T) { } func TestZipServingFromDisk(t *testing.T) { - skipUnlessEnabled(t, "not-inplace-chroot") - chdir := false defer testhelpers.ChdirInPath(t, "../../shared/pages", &chdir)() @@ -185,10 +183,22 @@ func TestZipServingFromDisk(t *testing.T) { expectedContent: "The page you're looking for could not be found", }, "file_not_allowed_in_path": { - host: "zip-not-allowed-path.gitlab.io", - urlSuffix: "/", - expectedStatusCode: http.StatusInternalServerError, - expectedContent: "Whoops, something went wrong on our end.", + host: "zip-not-allowed-path.gitlab.io", + urlSuffix: "/", + expectedStatusCode: func() int { + if os.Getenv("TEST_DAEMONIZE") == "inplace" { + return http.StatusNotFound + } + + return http.StatusInternalServerError + }(), + expectedContent: func() string { + if os.Getenv("TEST_DAEMONIZE") == "inplace" { + return "The page you're looking for could not be found" + } + + return "Whoops, something went wrong on our end." + }(), }, } |