diff options
author | James Fargher <jfargher@gitlab.com> | 2023-02-02 22:21:39 +0300 |
---|---|---|
committer | James Fargher <jfargher@gitlab.com> | 2023-02-02 23:26:18 +0300 |
commit | 01bd57b688349b14b92437d7432b50a53231e555 (patch) | |
tree | a2e7f882c7a438a368aae8ab0ffb89bd96f67a42 /internal/cache/walker_test.go | |
parent | fb2245e9f3644f9e63a47528a1195491d77e7366 (diff) |
Replace Mkdir(All) permissions with new perm package constants
There should be no actual permissions changes here. This is a
like-for-like replacement.
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 { |