1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

update pull-local#16756

Signed-off-by: heartlock <21521209@zju.edu.cn>
This commit is contained in:
heartlock 2015-10-10 09:09:53 +08:00
parent b7083cf08b
commit dc9dd188cf

View file

@ -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))
}
}