Skip to content

Commit

Permalink
TestCase: use icmd.RunCmd instead icmd.StartCmd
Browse files Browse the repository at this point in the history
Use `cli.Docker` instead `dockerCmdWithResult`.

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
  • Loading branch information
tao12345666333 committed Sep 2, 2019
1 parent 1a117b8 commit e6fce00
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions integration-cli/docker_cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1792,16 +1792,14 @@ func (s *DockerSuite) TestRunExitOnStdinClose(c *check.C) {
func (s *DockerSuite) TestRunInteractiveWithRestartPolicy(c *check.C) {
name := "test-inter-restart"

result := icmd.StartCmd(icmd.Cmd{
result := icmd.RunCmd(icmd.Cmd{
Command: []string{dockerBinary, "run", "-i", "--name", name, "--restart=always", "busybox", "sh"},
Stdin: bytes.NewBufferString("exit 11"),
})
assert.NilError(c, result.Error)
defer func() {
dockerCmdWithResult("stop", name).Assert(c, icmd.Success)
cli.Docker(cli.Args("stop", name)).Assert(c, icmd.Success)
}()

result = icmd.WaitOnCmd(60*time.Second, result)
result.Assert(c, icmd.Expected{ExitCode: 11})
}

Expand Down

0 comments on commit e6fce00

Please sign in to comment.