Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-04-30 09:35:13 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-05-11 10:28:42 +0300
commitdf52e3d3f98186ef29e912320bbfdacb768ad7c8 (patch)
treedb0108cc56a23a4918afca587957e0bf9847421d /test
parent8ea4cb76586c0841456c5973168cd8451f6c6c0a (diff)
Fail if disk is disabled
Return disk disabled error Remove useLegacyStorage leftovers Fix run process
Diffstat (limited to 'test')
-rw-r--r--test/acceptance/serving_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go
index b2ec4d05..e7f110f3 100644
--- a/test/acceptance/serving_test.go
+++ b/test/acceptance/serving_test.go
@@ -757,3 +757,25 @@ func headerValues(header http.Header, key string) []string {
// from Go 1.15 https://github.com/golang/go/blob/release-branch.go1.15/src/net/textproto/header.go#L46
return h[textproto.CanonicalMIMEHeaderKey(key)]
}
+
+func TestDiskDisabledFailsToServeFileAndLocalContent(t *testing.T) {
+ skipUnlessEnabled(t)
+
+ teardown := RunPagesProcessWithStubGitLabServer(t, true, *pagesBinary, []ListenSpec{httpListener}, "", nil, "-enable-disk=false")
+ defer teardown()
+
+ for host, suffix := range map[string]string{
+ // API serves "source": { "type": "local" }
+ "new-source-test.gitlab.io": "/my/pages/project/",
+ // API serves "source": { "type": "local", "path": "file://..." }
+ "zip-from-disk.gitlab.io": "/",
+ } {
+ t.Run(host, func(t *testing.T) {
+ rsp, err := GetPageFromListener(t, httpListener, host, suffix)
+ require.NoError(t, err)
+ defer rsp.Body.Close()
+
+ require.Equal(t, http.StatusInternalServerError, rsp.StatusCode)
+ })
+ }
+}