mirror of
https://github.com/moby/moby.git
synced 2025-08-01 05:47:11 +03:00
add integration test for error pull nonexistent
Signed-off-by: Jessica Frazelle <princess@docker.com>
This commit is contained in:
committed by
Josh Hawn
parent
fd4f7c4e5c
commit
7a525c6cb7
@ -98,8 +98,13 @@ func (s *DockerSuite) TestPullImageFromCentralRegistry(c *check.C) {
|
|||||||
|
|
||||||
// pulling a non-existing image from the central registry should return a non-zero exit code
|
// pulling a non-existing image from the central registry should return a non-zero exit code
|
||||||
func (s *DockerSuite) TestPullNonExistingImage(c *check.C) {
|
func (s *DockerSuite) TestPullNonExistingImage(c *check.C) {
|
||||||
pullCmd := exec.Command(dockerBinary, "pull", "fooblahblah1234")
|
testRequires(c, Network)
|
||||||
if out, _, err := runCommandWithOutput(pullCmd); err == nil {
|
|
||||||
|
name := "sadfsadfasdf"
|
||||||
|
pullCmd := exec.Command(dockerBinary, "pull", name)
|
||||||
|
out, _, err := runCommandWithOutput(pullCmd)
|
||||||
|
|
||||||
|
if err == nil || !strings.Contains(out, fmt.Sprintf("Error: image library/%s:latest not found", name)) {
|
||||||
c.Fatalf("expected non-zero exit status when pulling non-existing image: %s", out)
|
c.Fatalf("expected non-zero exit status when pulling non-existing image: %s", out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user