-
Notifications
You must be signed in to change notification settings - Fork 351
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 test process_capabilities_fail #3010
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kazuki Massaki <[email protected]> Signed-off-by: kazuki.massaki <[email protected]>
Signed-off-by: Kazuki Massaki <[email protected]> Signed-off-by: kazuki.massaki <[email protected]>
Signed-off-by: Kazuki Massaki <[email protected]> Signed-off-by: kazuki.massaki <[email protected]>
52dfb64
to
841a685
Compare
Signed-off-by: kazuki.massaki <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, Thanks for the PR! There is some change needed - basically the current test validates the capabilities call itself fails, i.e. it will error out from line 9. However, we want to check that the container creation itself fails. For this we will need to create a spec with invalid value, and then assert that the container creation has failed.
For this, what we can do is this -
- create a valid spec, with a single valid capacity
- then use this spec with
test_inside_container
- here you'll need to update the code of
test_inside_container
intest_utils:204
to return error instead of callingunwrap
. - In the function call, we get to provide a callback function which runs right before the container is created. This fn gets the rootfs path as a param. The spec (named config.json) it right outside the rootfs files for our tests, so you can edit the path to get the spec string, replace the cap name with an invalid name and re-write it there. Now we will have an invalid spec.
- here you'll need to update the code of
- With this, you can check that the
test_inside_container
fails because of the capabilities issue.
Please let me know if the above explanation is not clear/ you need any help.
Signed-off-by: kazuki.massaki <[email protected]>
beac1c7
to
2b72e74
Compare
@YJDoc2 |
Hey @kazmsk , thanks for the change, I'll try to take a look at this by the weekend. |
This implements the process_capabilities_fail validation in #361