mirror of
https://github.com/moby/moby.git
synced 2025-08-01 05:47:11 +03:00
Another try to fix InspectExecID
Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
@ -316,9 +316,9 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
|
|||||||
c.Fatalf("ExecIDs should be empty, got: %s", out)
|
c.Fatalf("ExecIDs should be empty, got: %s", out)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start an exec, have it block waiting for input so we can do some checking
|
// Start an exec, have it block waiting so we can do some checking
|
||||||
cmd := exec.Command(dockerBinary, "exec", "-i", id, "sh", "-c", "read a")
|
cmd := exec.Command(dockerBinary, "exec", id, "sh", "-c",
|
||||||
execStdin, _ := cmd.StdinPipe()
|
"while ! test -e /tmp/execid1; do sleep 1; done")
|
||||||
|
|
||||||
if err = cmd.Start(); err != nil {
|
if err = cmd.Start(); err != nil {
|
||||||
c.Fatalf("failed to start the exec cmd: %q", err)
|
c.Fatalf("failed to start the exec cmd: %q", err)
|
||||||
@ -349,8 +349,15 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
|
|||||||
c.Fatalf("failed to get the exec id: %v", err)
|
c.Fatalf("failed to get the exec id: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// End the exec by closing its stdin, and wait for it to end
|
// End the exec by creating the missing file
|
||||||
execStdin.Close()
|
err = exec.Command(dockerBinary, "exec", id,
|
||||||
|
"sh", "-c", "touch /tmp/execid1").Run()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
c.Fatalf("failed to run the 2nd exec cmd: %q", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for 1st exec to complete
|
||||||
cmd.Wait()
|
cmd.Wait()
|
||||||
|
|
||||||
// All execs for the container should be gone now
|
// All execs for the container should be gone now
|
||||||
|
Reference in New Issue
Block a user