Assert error in body of function inspectField*

1. Replace raw `docker inspect -f xxx` with `inspectField`, to make code
cleaner and more consistent
2. assert the error in function `inspectField*` so we don't need to
assert the return value of it every time, this will make inspect easier.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 62a856e9129c9d5cf7db9ea6322c9073d68e3ea4
Component: engine
This commit is contained in:
Zhang Wei
2016-01-28 22:19:25 +08:00
parent 86311e0101
commit 8bc92ae008
34 changed files with 298 additions and 591 deletions

View File

@ -431,7 +431,7 @@ func (s *DockerSuite) TestPsRightTagName(c *check.C) {
id2 = strings.TrimSpace(string(out))
var imageID string
out, _ = dockerCmd(c, "inspect", "-f", "{{.Id}}", "busybox")
out = inspectField(c, "busybox", "Id")
imageID = strings.TrimSpace(string(out))
var id3 string