mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #39853 from tao12345666333/testcase-TestRunInteractiveWithRestartPolicy
TestRunInteractiveWithRestartPolicy: use `icmd.RunCmd` instead `icmd.StartCmd`
This commit is contained in:
commit
65d58afb49
1 changed files with 2 additions and 4 deletions
|
@ -1789,16 +1789,14 @@ func (s *DockerSuite) TestRunExitOnStdinClose(c *testing.T) {
|
|||
func (s *DockerSuite) TestRunInteractiveWithRestartPolicy(c *testing.T) {
|
||||
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})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue