diff options
author | James Fargher <proglottis@gmail.com> | 2023-02-07 02:12:56 +0300 |
---|---|---|
committer | James Fargher <proglottis@gmail.com> | 2023-02-07 02:12:56 +0300 |
commit | 747602ecd05fb9d4aeb56bf4090c3a672561e11b (patch) | |
tree | b5cf72d4d069c6e1622910679f1fd05fe228fef0 /internal/cache/walker_test.go | |
parent | 6f245e94aebd51a39886eda6de9445a1c810c621 (diff) | |
parent | 01bd57b688349b14b92437d7432b50a53231e555 (diff) |
Merge branch 'centralise_dir_perms' into 'master'
Centralise directory permissions within the gitaly project
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5334
Merged-by: James Fargher <proglottis@gmail.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: Pavlo Strokov <pstrokov@gitlab.com>
Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Co-authored-by: James Fargher <jfargher@gitlab.com>
Diffstat (limited to 'internal/cache/walker_test.go')
-rw-r--r-- | internal/cache/walker_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/cache/walker_test.go b/internal/cache/walker_test.go index dc4f55f39..39ce3675e 100644 --- a/internal/cache/walker_test.go +++ b/internal/cache/walker_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/config" + "gitlab.com/gitlab-org/gitaly/v15/internal/helper/perm" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testcfg" ) @@ -38,7 +39,7 @@ func TestDiskCacheObjectWalker(t *testing.T) { require.NoError(t, err) path := filepath.Join(cacheDir, tt.name) - require.NoError(t, os.MkdirAll(filepath.Dir(path), 0o755)) + require.NoError(t, os.MkdirAll(filepath.Dir(path), perm.SharedDir)) f, err := os.Create(path) require.NoError(t, err) @@ -79,7 +80,7 @@ func TestDiskCacheInitialClear(t *testing.T) { require.NoError(t, err) canary := filepath.Join(cacheDir, "canary.txt") - require.NoError(t, os.MkdirAll(filepath.Dir(canary), 0o755)) + require.NoError(t, os.MkdirAll(filepath.Dir(canary), perm.SharedDir)) require.NoError(t, os.WriteFile(canary, []byte("chirp chirp"), 0o755)) cache := New(cfg, locator, withDisabledWalker()) @@ -115,7 +116,7 @@ func TestCleanWalkEmptyDirs(t *testing.T) { } { p := filepath.Join(tmp, tt.path) if strings.HasSuffix(tt.path, "/") { - require.NoError(t, os.MkdirAll(p, 0o755)) + require.NoError(t, os.MkdirAll(p, perm.SharedDir)) } else { require.NoError(t, os.WriteFile(p, nil, 0o655)) if tt.stale { |