mirror of
https://github.com/docker/cli.git
synced 2026-09-24 07:25:07 -05:00
Merge pull request #25861 from WeiZhang555/wait-remove-for-start
Using waitExitOrRemoved for `docker start` Upstream-commit: bdadcfc1bbb04950c4835cfa4d75f0e480555a2f Component: engine
This commit is contained in:
@@ -185,3 +185,15 @@ func (s *DockerSuite) TestStartAttachWithRename(c *check.C) {
|
||||
_, stderr, _, _ := runCommandWithStdoutStderr(exec.Command(dockerBinary, "start", "-a", "before"))
|
||||
c.Assert(stderr, checker.Not(checker.Contains), "No such container")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestStartReturnCorrectExitCode(c *check.C) {
|
||||
dockerCmd(c, "create", "--restart=on-failure:2", "--name", "withRestart", "busybox", "sh", "-c", "exit 11")
|
||||
dockerCmd(c, "create", "--rm", "--name", "withRm", "busybox", "sh", "-c", "exit 12")
|
||||
|
||||
_, exitCode, err := dockerCmdWithError("start", "-a", "withRestart")
|
||||
c.Assert(err, checker.NotNil)
|
||||
c.Assert(exitCode, checker.Equals, 11)
|
||||
_, exitCode, err = dockerCmdWithError("start", "-a", "withRm")
|
||||
c.Assert(err, checker.NotNil)
|
||||
c.Assert(exitCode, checker.Equals, 12)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user