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
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-05-04 15:57:23 +0300
committerJacob Vosmaer <jacob@gitlab.com>2018-05-04 15:57:23 +0300
commitbcc0335cab2e9c5429a3b544b0a0d80a1936fba0 (patch)
tree110dde9dba651b487b254dd671220b37c3fe951f /admin_test.go
parent69b7e196fe0336c91a44da72110f44c2ec0869b0 (diff)
Use permissive unix socket permissions
Diffstat (limited to 'admin_test.go')
-rw-r--r--admin_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/admin_test.go b/admin_test.go
index b6ccac09..7ceaa82a 100644
--- a/admin_test.go
+++ b/admin_test.go
@@ -6,6 +6,7 @@ import (
"net"
"net/http"
"net/http/httptest"
+ "os"
"testing"
"time"
@@ -25,6 +26,21 @@ var (
adminToken = "super-secret\n"
)
+func TestAdminUnixPermissions(t *testing.T) {
+ socketPath := "admin.socket"
+ // Use "../../" because the pages executable cd's into shared/pages
+ adminArgs := append(adminSecretArgs, "-admin-unix-listener", "../../"+socketPath)
+ teardown := RunPagesProcessWithoutWait(t, *pagesBinary, listeners, "", adminArgs...)
+ defer teardown()
+
+ waitHTTP2RoundTripUnix(t, socketPath)
+
+ st, err := os.Stat(socketPath)
+ require.NoError(t, err)
+ expectedMode := os.FileMode(0777)
+ require.Equal(t, expectedMode, st.Mode()&expectedMode, "file permissions of unix socket")
+}
+
func TestAdminHealthCheckUnix(t *testing.T) {
socketPath := "admin.socket"
// Use "../../" because the pages executable cd's into shared/pages