Skip to content

add a test for runc exec --cap#4406

Closed
lifubang wants to merge 1 commit into
opencontainers:mainfrom
lifubang:test-cap
Closed

add a test for runc exec --cap#4406
lifubang wants to merge 1 commit into
opencontainers:mainfrom
lifubang:test-cap

Conversation

@lifubang
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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