Skip to content

Commit

Permalink
Handle error for dockerCmdInDir
Browse files Browse the repository at this point in the history
Only two of these are not handled, the one in `TestBuildForceRm`
is intended to not be handled, while the other one in
`TestBuildResourceConstraintsAreUsed` causes problem.

In test case `TestBuildResourceConstraintsAreUsed`, somehow we
are not able to access network to get base image, but the error
message is:

```
Error: failed to inspect container : Unable to read inspect data: json: cannot unmarshal array into Go value of type types.ContainerJSON
```

Totally confusion.

Signed-off-by: Qiang Huang <[email protected]>
  • Loading branch information
hqhq committed Dec 30, 2015
1 parent 78ce43b commit 1b34008
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion integration-cli/docker_cli_build_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *check.C) {
`, map[string]string{})
c.Assert(err, checker.IsNil)

dockerCmdInDir(c, ctx.Dir, "build", "--no-cache", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpuset-mems=0", "--cpu-shares=100", "--cpu-quota=8000", "--ulimit", "nofile=42", "-t", name, ".")
_, _, err = dockerCmdInDir(c, ctx.Dir, "build", "--no-cache", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpuset-mems=0", "--cpu-shares=100", "--cpu-quota=8000", "--ulimit", "nofile=42", "-t", name, ".")
if err != nil {
c.Fatal(err)
}

out, _ := dockerCmd(c, "ps", "-lq")
cID := strings.TrimSpace(out)
Expand Down

0 comments on commit 1b34008

Please sign in to comment.