mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Ensure body is closed after error is checked
Signed-off-by: Antonio Murdaca <runcom@linux.com>
This commit is contained in:
parent
d593130fda
commit
18faf6f94e
6 changed files with 28 additions and 15 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue