1
0
Fork 0
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:
CrazyMax 2022-05-07 22:29:31 +02:00
parent 440d051ce9
commit ac82b2519a
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
2 changed files with 6 additions and 11 deletions

View file

@ -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")

View file

@ -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})
}