Signed-off-by: John Howard <jhoward@microsoft.com>
| ... | ... |
@@ -16,7 +16,6 @@ import ( |
| 16 | 16 |
|
| 17 | 17 |
// Regression test for #9414 |
| 18 | 18 |
func (s *DockerSuite) TestExecApiCreateNoCmd(c *check.C) {
|
| 19 |
- testRequires(c, DaemonIsLinux) |
|
| 20 | 19 |
name := "exec_test" |
| 21 | 20 |
dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh") |
| 22 | 21 |
|
| ... | ... |
@@ -29,7 +28,6 @@ func (s *DockerSuite) TestExecApiCreateNoCmd(c *check.C) {
|
| 29 | 29 |
} |
| 30 | 30 |
|
| 31 | 31 |
func (s *DockerSuite) TestExecApiCreateNoValidContentType(c *check.C) {
|
| 32 |
- testRequires(c, DaemonIsLinux) |
|
| 33 | 32 |
name := "exec_test" |
| 34 | 33 |
dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh") |
| 35 | 34 |
|
| ... | ... |
@@ -50,6 +48,7 @@ func (s *DockerSuite) TestExecApiCreateNoValidContentType(c *check.C) {
|
| 50 | 50 |
} |
| 51 | 51 |
|
| 52 | 52 |
func (s *DockerSuite) TestExecApiCreateContainerPaused(c *check.C) {
|
| 53 |
+ // Not relevant on Windows as Windows containers cannot be paused |
|
| 53 | 54 |
testRequires(c, DaemonIsLinux) |
| 54 | 55 |
name := "exec_create_test" |
| 55 | 56 |
dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh") |
| ... | ... |
@@ -63,7 +62,7 @@ func (s *DockerSuite) TestExecApiCreateContainerPaused(c *check.C) {
|
| 63 | 63 |
c.Assert(string(body), checker.Contains, "Container "+name+" is paused, unpause the container before exec", comment) |
| 64 | 64 |
} |
| 65 | 65 |
|
| 66 |
-func (s *DockerSuite) TestExecAPIStart(c *check.C) {
|
|
| 66 |
+func (s *DockerSuite) TestExecApiStart(c *check.C) {
|
|
| 67 | 67 |
testRequires(c, DaemonIsLinux) // Uses pause/unpause but bits may be salvagable to Windows to Windows CI |
| 68 | 68 |
dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top") |
| 69 | 69 |
|
| ... | ... |
@@ -86,8 +85,8 @@ func (s *DockerSuite) TestExecAPIStart(c *check.C) {
|
| 86 | 86 |
startExec(c, id, http.StatusOK) |
| 87 | 87 |
} |
| 88 | 88 |
|
| 89 |
-func (s *DockerSuite) TestExecAPIStartBackwardsCompatible(c *check.C) {
|
|
| 90 |
- dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top") |
|
| 89 |
+func (s *DockerSuite) TestExecApiStartBackwardsCompatible(c *check.C) {
|
|
| 90 |
+ runSleepingContainer(c, "-d", "--name", "test") |
|
| 91 | 91 |
id := createExec(c, "test") |
| 92 | 92 |
|
| 93 | 93 |
resp, body, err := sockRequestRaw("POST", fmt.Sprintf("/v1.20/exec/%s/start", id), strings.NewReader(`{"Detach": true}`), "text/plain")
|
| ... | ... |
@@ -100,12 +99,12 @@ func (s *DockerSuite) TestExecAPIStartBackwardsCompatible(c *check.C) {
|
| 100 | 100 |
} |
| 101 | 101 |
|
| 102 | 102 |
// #19362 |
| 103 |
-func (s *DockerSuite) TestExecAPIStartMultipleTimesError(c *check.C) {
|
|
| 104 |
- dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top") |
|
| 103 |
+func (s *DockerSuite) TestExecApiStartMultipleTimesError(c *check.C) {
|
|
| 104 |
+ runSleepingContainer(c, "-d", "--name", "test") |
|
| 105 | 105 |
execID := createExec(c, "test") |
| 106 | 106 |
startExec(c, execID, http.StatusOK) |
| 107 | 107 |
|
| 108 |
- timeout := time.After(10 * time.Second) |
|
| 108 |
+ timeout := time.After(60 * time.Second) |
|
| 109 | 109 |
var execJSON struct{ Running bool }
|
| 110 | 110 |
for {
|
| 111 | 111 |
select {
|