-
Notifications
You must be signed in to change notification settings - Fork 402
Add poststart_fail hook test #3313
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Pavel Safronov <pv.safronov@gmail.com>
|
Hey @YJDoc2 Can you help me with containerd-integration-tests failure? It fails on I can't see how it could be related to the change I made here. |
|
As you said, this PR only changes test code, so the containerd-test error is unrelated. |
saku3
left a comment
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.
Thank you for the PR.
Overall, it looks good to me, but I left two comments.
Could you please take a look?
Signed-off-by: Pavel Safronov <pv.safronov@gmail.com>
|
I've addressed the comments, but one of the tests timed out. Pretty sure it is not related to my change, so will be happy if someone can trigger a re-run. |
|
LGTM w/ one nit |
Signed-off-by: Pavel Safronov <pv.safronov@gmail.com>
Description
This implements a test similar to https://github.com/opencontainers/runtime-tools/blob/master/validation/poststart_fail/poststart_fail.go as a part of the #361
Type of Change
Testing
Related Issues
#361
Additional Context
The test is similar to the happy case test landed in #3292 but it focuses on the error handling.
I made it a bit different to the original go test to make sure we also test a couple of more things. I create three hooks, with the second hook failing. We expect that the first two hooks to run and exit with an error. The hook after the failed hook should not run as implied by the lifecycle spec https://github.com/opencontainers/runtime-spec/blob/main/runtime.md#lifecycle.
One assumption I make here is that the hooks are executed in the same order they're defined in a spec, which is not explicitly stated anywhere in the runtime spec but anyway I think it is a relatively safe assumption and it is nice to guarantee this order even if the spec doesn't require it.
Also, this test is affected by the same bug as a happy case scenario opencontainers/runc#4347 so an extra branch has been added to handle the incorrect runc behaviour.