From dc9dd188cf384d2ab868444bed74417a062d3592 Mon Sep 17 00:00:00 2001 From: heartlock <21521209@zju.edu.cn> Date: Sat, 10 Oct 2015 09:09:53 +0800 Subject: [PATCH] update pull-local#16756 Signed-off-by: heartlock <21521209@zju.edu.cn> --- integration-cli/docker_cli_pull_local_test.go | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/integration-cli/docker_cli_pull_local_test.go b/integration-cli/docker_cli_pull_local_test.go index a875f38456..2d5374bef9 100644 --- a/integration-cli/docker_cli_pull_local_test.go +++ b/integration-cli/docker_cli_pull_local_test.go @@ -34,9 +34,8 @@ func (s *DockerRegistrySuite) TestPullImageWithAliases(c *check.C) { dockerCmd(c, "pull", repos[0]) dockerCmd(c, "inspect", repos[0]) for _, repo := range repos[1:] { - if _, _, err := dockerCmdWithError("inspect", repo); err == nil { - c.Fatalf("Image %v shouldn't have been pulled down", repo) - } + _, _, err := dockerCmdWithError("inspect", repo) + c.Assert(err, check.NotNil, check.Commentf("Image %v shouldn't have been pulled down", repo)) } } @@ -54,9 +53,7 @@ func (s *DockerRegistrySuite) TestConcurrentPullWholeRepo(c *check.C) { ENV BAR bar CMD echo %s `, repo), true) - if err != nil { - c.Fatal(err) - } + c.Assert(err, check.IsNil) dockerCmd(c, "push", repo) repos = append(repos, repo) } @@ -87,9 +84,7 @@ func (s *DockerRegistrySuite) TestConcurrentPullWholeRepo(c *check.C) { for _, repo := range repos { dockerCmd(c, "inspect", repo) out, _ := dockerCmd(c, "run", "--rm", repo) - if strings.TrimSpace(out) != "/bin/sh -c echo "+repo { - c.Fatalf("CMD did not contain /bin/sh -c echo %s: %s", repo, out) - } + c.Assert(strings.TrimSpace(out), check.Equals, "/bin/sh -c echo "+repo, check.Commentf("CMD did not contain /bin/sh -c echo %s: %s", repo, out)) } } @@ -112,9 +107,7 @@ func (s *DockerRegistrySuite) TestConcurrentFailingPull(c *check.C) { // package is not goroutine-safe. for i := 0; i != numPulls; i++ { err := <-results - if err == nil { - c.Fatal("expected pull to fail") - } + c.Assert(err, check.NotNil, check.Commentf("expected pull to fail")) } } @@ -133,9 +126,7 @@ func (s *DockerRegistrySuite) TestConcurrentPullMultipleTags(c *check.C) { ENV BAR bar CMD echo %s `, repo), true) - if err != nil { - c.Fatal(err) - } + c.Assert(err, check.IsNil) dockerCmd(c, "push", repo) repos = append(repos, repo) } @@ -165,8 +156,6 @@ func (s *DockerRegistrySuite) TestConcurrentPullMultipleTags(c *check.C) { for _, repo := range repos { dockerCmd(c, "inspect", repo) out, _ := dockerCmd(c, "run", "--rm", repo) - if strings.TrimSpace(out) != "/bin/sh -c echo "+repo { - c.Fatalf("CMD did not contain /bin/sh -c echo %s: %s", repo, out) - } + c.Assert(strings.TrimSpace(out), check.Equals, "/bin/sh -c echo "+repo, check.Commentf("CMD did not contain /bin/sh -c echo %s; %s", repo, out)) } }