mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
integration-cli: refactor TestStartReturnCorrectExitCode
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
440d051ce9
commit
ac82b2519a
2 changed files with 6 additions and 11 deletions
|
@ -249,7 +249,8 @@ func (s *DockerSuite) TestRestartPolicyAfterRestart(c *testing.T) {
|
|||
// such that it assumes there is a host process to kill. In Hyper-V
|
||||
// containers, the process is inside the utility VM, not on the host.
|
||||
if DaemonIsWindows() {
|
||||
testRequires(c, testEnv.DaemonInfo.Isolation.IsProcess, testEnv.NotGitHubActions)
|
||||
skip.If(c, testEnv.GitHubActions())
|
||||
testRequires(c, testEnv.DaemonInfo.Isolation.IsProcess)
|
||||
}
|
||||
|
||||
out := runSleepingContainer(c, "-d", "--restart=always")
|
||||
|
|
|
@ -186,14 +186,8 @@ func (s *DockerSuite) TestStartAttachWithRename(c *testing.T) {
|
|||
}
|
||||
|
||||
func (s *DockerSuite) TestStartReturnCorrectExitCode(c *testing.T) {
|
||||
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")
|
||||
|
||||
out, exitCode, err := dockerCmdWithError("start", "-a", "withRestart")
|
||||
assert.ErrorContains(c, err, "")
|
||||
assert.Equal(c, exitCode, 11, fmt.Sprintf("out: %s", out))
|
||||
|
||||
out, exitCode, err = dockerCmdWithError("start", "-a", "withRm")
|
||||
assert.ErrorContains(c, err, "")
|
||||
assert.Equal(c, exitCode, 12, fmt.Sprintf("out: %s", out))
|
||||
cli.DockerCmd(c, "create", "--restart=on-failure:2", "--name", "withRestart", "busybox", "sh", "-c", "exit 11")
|
||||
cli.DockerCmd(c, "create", "--rm", "--name", "withRm", "busybox", "sh", "-c", "exit 12")
|
||||
cli.Docker(cli.Args("start", "-a", "withRestart")).Assert(c, icmd.Expected{ExitCode: 11})
|
||||
cli.Docker(cli.Args("start", "-a", "withRm")).Assert(c, icmd.Expected{ExitCode: 12})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue