Skip to content

client/tests: Fix spurious test keyring paths#426

Merged
bilelmoussaoui merged 1 commit intolinux-credentials:mainfrom
haxtibal:test/fix_keyring_path
Mar 14, 2026
Merged

client/tests: Fix spurious test keyring paths#426
bilelmoussaoui merged 1 commit intolinux-credentials:mainfrom
haxtibal:test/fix_keyring_path

Conversation

@haxtibal
Copy link
Contributor

file_unlocked_keyring.rs calculated the path for test keyring like "../../tests/test.keyring". This usually goes outside the project root. For example

~/oo7 $ cargo test

creates ~/tests/test.keyring. Depending on directory setup, tests pass unnoticed, fail with permission denied or worst case corrupt unrelated previously existing files.

Fix it by using tempdir(), as other tests already do it.

file_unlocked_keyring.rs calculated the path for test keyring like
'../../tests/test.keyring'. This usually goes outside the project root.
For example

  ~/oo7 $ cargo test

creates ~/tests/test.keyring. Depending on directory setup, tests pass
unnoticed, fail with permission denied or worst case corrupt unrelated
previously existing files.

Fix it by using tempdir(), as other tests already do it.
@bilelmoussaoui bilelmoussaoui merged commit cb22e0f into linux-credentials:main Mar 14, 2026
16 checks passed
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