Fix certifier test permissions - #13473
Open
bneradt wants to merge 1 commit into
Open
Conversation
Certifier tests fail in root-run CI because ATS cannot update the copied serial file or certificate store. Local owner-run tests mask the problem. This problem is addressed in this patch by giving the unprivileged ATS process the required access to the serial file and certificate store in each certifier scenario.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the certifier gold tests to avoid permission failures when the CI harness runs as root but the ATS process runs unprivileged, ensuring ATS can update the copied CA serial file and certificate store across all certifier scenarios.
Changes:
- Creates explicit
store_pathandserial_pathvariables for each certifier scenario setup. - Adjusts permissions on the copied
ca-serial.txtand thestore/directory to allow the unprivileged ATS process to write.
Suppressed comments (3)
tests/gold_tests/pluginTest/certifier/certifier.test.py:135
- Using Setup.RunCommand with an unquoted shell command (and
&&) is brittle: paths with spaces/shell metacharacters will break, and this needlessly invokes a shell. Prefer adjusting permissions via Python (os.chmod) in-process.
Setup.RunCommand(f'chmod a+rw {serial_path} && chmod a+rwx {store_path}')
tests/gold_tests/pluginTest/certifier/certifier.test.py:195
- Using Setup.RunCommand with an unquoted shell command (and
&&) is brittle: paths with spaces/shell metacharacters will break, and this needlessly invokes a shell. Prefer adjusting permissions via Python (os.chmod) in-process.
Setup.RunCommand(f'chmod a+rw {serial_path} && chmod a+rwx {store_path}')
tests/gold_tests/pluginTest/certifier/certifier.test.py:261
- Using Setup.RunCommand with an unquoted shell command (and
&&) is brittle: paths with spaces/shell metacharacters will break, and this needlessly invokes a shell. Prefer adjusting permissions via Python (os.chmod) in-process.
Setup.RunCommand(f'chmod a+rw {serial_path} && chmod a+rwx {store_path}')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Certifier tests fail in root-run CI because ATS cannot update the
copied serial file or certificate store. Local owner-run tests mask the
problem.
This problem is addressed in this patch by giving the unprivileged ATS
process the required access to the serial file and certificate store in
each certifier scenario.