-
Notifications
You must be signed in to change notification settings - Fork 460
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
critest: Add test for pid namespace #267
Conversation
@mrunalp PTAL |
pkg/validate/security_context.go
Outdated
By("get nginx container pid") | ||
command := []string{"cat", "/proc/1/cmdline"} | ||
output := execSyncContainer(rc, containerID, command) | ||
Expect(string(output)).To(ContainSubstring("pause")) |
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.
pause depends upon what container is being used by the runtime. I guess doing a not of "master process" will be more portable across runtimes and different pod infra containers.
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.
okay, fixed.
pkg/validate/streaming.go
Outdated
checkExec(rc, req, "hello\n", false) | ||
}) | ||
|
||
It("runtime should support exec with -it flags", func() { |
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.
You should make a different PR for exec tests. Also we should add a test for exec without -it in that PR.
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.
Removed the exec test, will open another PR with those tests.
Add test for pid namespace = container Add test for pid namespace = pod Signed-off-by: umohnani8 <[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.
/lgtm
@feiskyer What is the difference between these 2 test cases? Shouldn't we test one container can/can't not access pid in another container? |
I see. One is contain, another is not contain. :) |
Add test for pid namespace = container
Add test for pid namespace = pod
Addresses issue #237
Signed-off-by: umohnani8 [email protected]