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

add a test for runc exec --cap #4406

Closed
wants to merge 1 commit into from

Conversation

lifubang
Copy link
Member

No description provided.

Signed-off-by: lifubang <lifubang@acmcoder.com>
[[ "${output}" == *"CapBnd: 0000000400000021"* ]]
[[ "${output}" == *"CapEff: 0000000000000021"* ]]
[[ "${output}" == *"CapPrm: 0000000000000021"* ]]
[[ "${output}" == *"CapAmb: 0000000000000001"* ]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add comments to help understanding these bitmasks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll add them later.

rata
rata previously approved these changes Sep 24, 2024
Copy link
Member

@rata rata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @lifubang do you want to add the comments before merging?

update_config '.process.capabilities.inheritable = ["CAP_CHOWN", "CAP_SYSLOG"]'
update_config '.process.capabilities.ambient = ["CAP_CHOWN"]'
__runc run -d test_some_caps
[ "$status" -eq 0 ]
Copy link
Contributor

@kolyshkin kolyshkin Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not checking runc exit code here, because __runc doesn't use bats' run which sets $status.

If you copied this code from some other place -- that place is also wrong.

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to explain (either in a commit message or in the test itself) what exactly are you checking for.

@kolyshkin
Copy link
Contributor

I will add this test to #4367.

@rata rata dismissed their stale review September 25, 2024 09:21

Will be moved to another PR and adjusted to check for the status

@kolyshkin
Copy link
Contributor

This is now part of #4367.

@kolyshkin kolyshkin closed this Sep 26, 2024
@lifubang lifubang deleted the test-cap branch October 15, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants