-
Notifications
You must be signed in to change notification settings - Fork 141
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 case for KillNonCreateRunHaveNoEffect #607
Conversation
Signed-off-by: Liang Chenye <[email protected]>
Currently we have 4 statuses: creating/created/running/stopped. Since 'created' and 'running' are out of this testing and it is hard to catch the 'creating' status, we can only test the 'stopped' container. If there were any 'effect' when kill a 'stopped' container, it might reflect on the state. I don't have an idea on other 'effect', so in this PR I check the state changes. |
looks good. @wking WDYT? |
if err != nil { | ||
return err | ||
} | ||
r.Kill("KILL") |
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.
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.
* *Exit code:* Zero if the signal was successfully sent to the container process and non-zero on errors.
I found there is no general exit code, there is golang syscall pkg, but just works in posix system.
So do we still need this 'Exit code' session in command-line-interface?
if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
log.Printf("Exit Status: %d", status.ExitStatus())
}
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.
The return error is check in kill.go
. There is a bug in the previous kill.go, it displays the wrong spec error code. The new commit 0ddb5cd solves that.
Signed-off-by: Liang Chenye <[email protected]>
Signed-off-by: Liang Chenye [email protected]