diff options
author | allencloud <allen.sun@daocloud.io> | 2017-02-02 04:03:58 +0800 |
---|---|---|
committer | allencloud <allen.sun@daocloud.io> | 2017-03-10 16:09:09 +0800 |
commit | fb1f22b06a8785af3ddf4bf8893de75a52295cf8 (patch) | |
tree | a78e8f22615b211d6370a81c0346b8ce89777522 /integration-cli/docker_cli_inspect_test.go | |
parent | 239645c08d63c747eee523ba3459402172120bd8 (diff) | |
download | docker-fb1f22b06a8785af3ddf4bf8893de75a52295cf8.tar.gz |
do not fail fast when executing inspect command
Signed-off-by: allencloud <allen.sun@daocloud.io>
Diffstat (limited to 'integration-cli/docker_cli_inspect_test.go')
-rw-r--r-- | integration-cli/docker_cli_inspect_test.go | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go index a4d2dfa7e2..330cfc9a1b 100644 --- a/integration-cli/docker_cli_inspect_test.go +++ b/integration-cli/docker_cli_inspect_test.go @@ -353,14 +353,22 @@ func (s *DockerSuite) TestInspectByPrefix(c *check.C) { } func (s *DockerSuite) TestInspectStopWhenNotFound(c *check.C) { - runSleepingContainer(c, "--name=busybox", "-d") - runSleepingContainer(c, "--name=not-shown", "-d") - out, _, err := dockerCmdWithError("inspect", "--type=container", "--format='{{.Name}}'", "busybox", "missing", "not-shown") - - c.Assert(err, checker.Not(check.IsNil)) - c.Assert(out, checker.Contains, "busybox") - c.Assert(out, checker.Not(checker.Contains), "not-shown") - c.Assert(out, checker.Contains, "Error: No such container: missing") + runSleepingContainer(c, "--name=busybox1", "-d") + runSleepingContainer(c, "--name=busybox2", "-d") + result := dockerCmdWithResult("inspect", "--type=container", "--format='{{.Name}}'", "busybox1", "busybox2", "missing") + + c.Assert(result.Error, checker.Not(check.IsNil)) + c.Assert(result.Stdout(), checker.Contains, "busybox1") + c.Assert(result.Stdout(), checker.Contains, "busybox2") + c.Assert(result.Stderr(), checker.Contains, "Error: No such container: missing") + + // test inspect would not fast fail + result = dockerCmdWithResult("inspect", "--type=container", "--format='{{.Name}}'", "missing", "busybox1", "busybox2") + + c.Assert(result.Error, checker.Not(check.IsNil)) + c.Assert(result.Stdout(), checker.Contains, "busybox1") + c.Assert(result.Stdout(), checker.Contains, "busybox2") + c.Assert(result.Stderr(), checker.Contains, "Error: No such container: missing") } func (s *DockerSuite) TestInspectHistory(c *check.C) { |