fix a panic when the exec fails to start

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
This commit is contained in:
Shijiang Wei
2015-08-22 00:01:44 +08:00
parent 5ceff3f191
commit fcf9daad91
3 changed files with 18 additions and 3 deletions
+11
View File
@@ -595,3 +595,14 @@ func (s *DockerSuite) TestExecOnReadonlyContainer(c *check.C) {
c.Fatalf("exec into a read-only container failed with exit status %d", status)
}
}
// #15750
func (s *DockerSuite) TestExecStartFails(c *check.C) {
name := "exec-15750"
dockerCmd(c, "run", "-d", "--name", name, "busybox", "top")
_, errmsg, status := dockerCmdWithStdoutStderr(nil, "exec", name, "no-such-cmd")
if status == 255 && !strings.Contains(errmsg, "executable file not found") {
c.Fatal("exec error message not received. The daemon might had crashed")
}
}