The container started with `-d` as part of the test requires a `waitRun`
to ensure it is actually running before attempting any other operation.
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
| ... | ... |
@@ -21,9 +21,10 @@ import ( |
| 21 | 21 |
|
| 22 | 22 |
func (s *DockerSuite) TestExec(c *check.C) {
|
| 23 | 23 |
testRequires(c, DaemonIsLinux) |
| 24 |
- dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top") |
|
| 24 |
+ out, _ := dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top") |
|
| 25 |
+ c.Assert(waitRun(strings.TrimSpace(out)), check.IsNil) |
|
| 25 | 26 |
|
| 26 |
- out, _ := dockerCmd(c, "exec", "testing", "cat", "/tmp/file") |
|
| 27 |
+ out, _ = dockerCmd(c, "exec", "testing", "cat", "/tmp/file") |
|
| 27 | 28 |
out = strings.Trim(out, "\r\n") |
| 28 | 29 |
c.Assert(out, checker.Equals, "test") |
| 29 | 30 |
|
| ... | ... |
@@ -67,7 +68,7 @@ func (s *DockerSuite) TestExecInteractive(c *check.C) {
|
| 67 | 67 |
|
| 68 | 68 |
func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
|
| 69 | 69 |
testRequires(c, DaemonIsLinux) |
| 70 |
- out, _ := runSleepingContainer(c, "-d") |
|
| 70 |
+ out, _ := runSleepingContainer(c) |
|
| 71 | 71 |
cleanedContainerID := strings.TrimSpace(out) |
| 72 | 72 |
c.Assert(waitRun(cleanedContainerID), check.IsNil) |
| 73 | 73 |
dockerCmd(c, "restart", cleanedContainerID) |