mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 21:51:33 +00:00
Ensure body is closed after error is checked
Signed-off-by: Antonio Murdaca <runcom@linux.com>
This commit is contained in:
@@ -17,8 +17,8 @@ func (s *DockerSuite) TestExecApiCreateNoCmd(c *check.C) {
|
||||
dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
|
||||
|
||||
status, body, err := sockRequest("POST", fmt.Sprintf("/containers/%s/exec", name), map[string]interface{}{"Cmd": nil})
|
||||
c.Assert(status, check.Equals, http.StatusInternalServerError)
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(status, check.Equals, http.StatusInternalServerError)
|
||||
|
||||
if !bytes.Contains(body, []byte("No exec command specified")) {
|
||||
c.Fatalf("Expected message when creating exec command with no Cmd specified")
|
||||
|
||||
Reference in New Issue
Block a user