mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Windows CI: Port TestKill*
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
a7fefcf16c
commit
03e2ff322b
1 changed files with 8 additions and 10 deletions
|
@ -10,8 +10,7 @@ import (
|
|||
)
|
||||
|
||||
func (s *DockerSuite) TestKillContainer(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
|
||||
out, _ := runSleepingContainer(c, "-d")
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
c.Assert(waitRun(cleanedContainerID), check.IsNil)
|
||||
|
||||
|
@ -22,9 +21,8 @@ func (s *DockerSuite) TestKillContainer(c *check.C) {
|
|||
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestKillofStoppedContainer(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
|
||||
func (s *DockerSuite) TestKillOffStoppedContainer(c *check.C) {
|
||||
out, _ := runSleepingContainer(c, "-d")
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
|
||||
dockerCmd(c, "stop", cleanedContainerID)
|
||||
|
@ -34,6 +32,7 @@ func (s *DockerSuite) TestKillofStoppedContainer(c *check.C) {
|
|||
}
|
||||
|
||||
func (s *DockerSuite) TestKillDifferentUserContainer(c *check.C) {
|
||||
// TODO Windows: Windows does not yet support -u (Feb 2016).
|
||||
testRequires(c, DaemonIsLinux)
|
||||
out, _ := dockerCmd(c, "run", "-u", "daemon", "-d", "busybox", "top")
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
|
@ -48,6 +47,7 @@ func (s *DockerSuite) TestKillDifferentUserContainer(c *check.C) {
|
|||
|
||||
// regression test about correct signal parsing see #13665
|
||||
func (s *DockerSuite) TestKillWithSignal(c *check.C) {
|
||||
// Cannot port to Windows - does not support signals in the same was a Linux does
|
||||
testRequires(c, DaemonIsLinux)
|
||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
|
||||
cid := strings.TrimSpace(out)
|
||||
|
@ -61,8 +61,7 @@ func (s *DockerSuite) TestKillWithSignal(c *check.C) {
|
|||
}
|
||||
|
||||
func (s *DockerSuite) TestKillWithInvalidSignal(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
|
||||
out, _ := runSleepingContainer(c, "-d")
|
||||
cid := strings.TrimSpace(out)
|
||||
c.Assert(waitRun(cid), check.IsNil)
|
||||
|
||||
|
@ -73,7 +72,7 @@ func (s *DockerSuite) TestKillWithInvalidSignal(c *check.C) {
|
|||
running := inspectField(c, cid, "State.Running")
|
||||
c.Assert(running, checker.Equals, "true", check.Commentf("Container should be in running state after an invalid signal"))
|
||||
|
||||
out, _ = dockerCmd(c, "run", "-d", "busybox", "top")
|
||||
out, _ = runSleepingContainer(c, "-d")
|
||||
cid = strings.TrimSpace(out)
|
||||
c.Assert(waitRun(cid), check.IsNil)
|
||||
|
||||
|
@ -87,8 +86,7 @@ func (s *DockerSuite) TestKillWithInvalidSignal(c *check.C) {
|
|||
}
|
||||
|
||||
func (s *DockerSuite) TestKillStoppedContainerAPIPre120(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
dockerCmd(c, "run", "--name", "docker-kill-test-api", "-d", "busybox", "top")
|
||||
runSleepingContainer(c, "--name", "docker-kill-test-api", "-d")
|
||||
dockerCmd(c, "stop", "docker-kill-test-api")
|
||||
|
||||
status, _, err := sockRequest("POST", fmt.Sprintf("/v1.19/containers/%s/kill", "docker-kill-test-api"), nil)
|
||||
|
|
Loading…
Reference in a new issue