Test for issue #9699

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
Alexandr Morozov 2014-12-26 17:19:23 -08:00
parent 8722b6db4b
commit eda92e8834
1 changed files with 25 additions and 0 deletions

View File

@ -367,3 +367,28 @@ func TestExecParseError(t *testing.T) {
}
logDone("exec - error on parseExec should return usage")
}
func TestExecStopNotHanging(t *testing.T) {
defer deleteAllContainers()
if out, err := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "top").CombinedOutput(); err != nil {
t.Fatal(out, err)
}
if err := exec.Command(dockerBinary, "exec", "testing", "top").Start(); err != nil {
t.Fatal(err)
}
wait := make(chan struct{})
go func() {
if out, err := exec.Command(dockerBinary, "stop", "testing").CombinedOutput(); err != nil {
t.Fatal(out, err)
}
close(wait)
}()
select {
case <-time.After(3 * time.Second):
t.Fatal("Container stop timed out")
case <-wait:
}
logDone("exec - container with exec not hanging on stop")
}