Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TestGnuPGHome_Validate #1370

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

stormentt
Copy link
Contributor

On my stock Ubuntu 22.04 machine with Go 1.21 one of the tests fails:

--- FAIL: TestGnuPGHome_Validate (0.00s)
    --- FAIL: TestGnuPGHome_Validate/wrong_permissions (0.00s)
        keysource_test.go:134: 
                Error Trace:    /home/xmo/pro/sops/pgp/keysource_test.go:134
                Error:          An error is expected but got nil.
                Test:           TestGnuPGHome_Validate/wrong_permissions

The test assumes that t.TempDir() returns a directory with mode 0755.

Taking a look at testing.go:1221 shows that this uses os.MkdirTemp(), which calls Mkdir(name, 0700), causing the test to fail.

To fix this I modified the test to explicitly set the mode on the tempdir to 0755.

Signed-off-by: Tanner Storment <tannerstorment@gmail.com>
@felixfontein felixfontein merged commit 0d58c35 into getsops:main Dec 10, 2023
9 checks passed
@felixfontein
Copy link
Contributor

@stormentt thanks a lot for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants