test(contest): add update pids limit integration test#3595
Merged
Conversation
Contributor
Author
Signed-off-by: moz-sec <m0253c@gmail.com>
24b4e29 to
89edaec
Compare
Signed-off-by: moz-sec <m0253c@gmail.com>
Contributor
Author
saku3
reviewed
Jun 27, 2026
saku3
left a comment
Member
There was a problem hiding this comment.
Thank you for the PR.
I left one comment. Please take a look when you have a chance.
| .unwrap(); | ||
| test_result!(check_cgroup_value(&cgroup_path, "pids.max", "max")); | ||
|
|
||
| // update pids.limit to 0, pids.max will become 1 |
Member
There was a problem hiding this comment.
Could we explain why pids-limit 0 maps to pids.max = 1?
It seems to follow runc’s behavior, but the reason is not obvious from the current comment.
Contributor
Author
There was a problem hiding this comment.
Set pids.max = 0 in a cgroup, new processes will no longer be created, causing the container to fail to start.
For this reason, runc converts the value of --pids-limit to 1 if it is 0.
This test is designed to match that behavior of runc.
I added this explanation as a comment in pids_limit.rs.
Signed-off-by: moz-sec <m0253c@gmail.com>
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.
Description
Type of Change
Testing
Related Issues
Imprement #3576
Additional Context
As noted in #3594, the test for
--update pids-limitfails, so skipped it.I have confirmed that the test passes in runc.
This integration test was created based on the following description in updates.bats.
https://github.com/opencontainers/runc/blob/da3d022b06dd96a898f6d0cc1df2773df91ea035/tests/integration/update.bats#L330-L359