diff --git a/integration-cli/docker_cli_pull_local_test.go b/integration-cli/docker_cli_pull_local_test.go index 1f8583204e..f26827a80b 100644 --- a/integration-cli/docker_cli_pull_local_test.go +++ b/integration-cli/docker_cli_pull_local_test.go @@ -421,3 +421,26 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuth(c *check.C) { dockerCmd(c, "--config", tmp, "pull", repoName) } + +// TestRunImplicitPullWithNoTag should pull implicitely only the default tag (latest) +func (s *DockerRegistrySuite) TestRunImplicitPullWithNoTag(c *check.C) { + testRequires(c, DaemonIsLinux) + repo := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL) + repoTag1 := fmt.Sprintf("%v:latest", repo) + repoTag2 := fmt.Sprintf("%v:t1", repo) + // tag the image and upload it to the private registry + dockerCmd(c, "tag", "busybox", repoTag1) + dockerCmd(c, "tag", "busybox", repoTag2) + dockerCmd(c, "push", repo) + dockerCmd(c, "rmi", repoTag1) + dockerCmd(c, "rmi", repoTag2) + + out, _, err := dockerCmdWithError("run", repo) + c.Assert(err, check.IsNil) + c.Assert(out, checker.Contains, fmt.Sprintf("Unable to find image '%s:latest' locally", repo)) + + // There should be only one line for repo, the one with repo:latest + outImageCmd, _, err := dockerCmdWithError("images", repo) + splitOutImageCmd := strings.Split(strings.TrimSpace(outImageCmd), "\n") + c.Assert(splitOutImageCmd, checker.HasLen, 2) +} diff --git a/integration-cli/docker_cli_pull_test.go b/integration-cli/docker_cli_pull_test.go index 3f91ac1d01..c9f4ef195f 100644 --- a/integration-cli/docker_cli_pull_test.go +++ b/integration-cli/docker_cli_pull_test.go @@ -237,20 +237,6 @@ func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *check.C) { c.Assert(splitLatest, checker.DeepEquals, splitCurrent, check.Commentf("busybox:latest was changed after pulling all tags")) } -// TestRunImplicitPullWithNoTagOnlyPullDefaultTag should pull implicitely only the default tag (latest) -func (s *DockerHubPullSuite) TestRunImplicitPullWithNoTagOnlyPullDefaultTag(c *check.C) { - // run with an image we don't have - testRequires(c, DaemonIsLinux) - out := s.Cmd(c, "run", "busybox") - - c.Assert(out, checker.Contains, "Unable to find image 'busybox:latest' locally") - - // There should be only one line for busybox, the one with busybox:latest - outImageCmd := s.Cmd(c, "images", "busybox") - splitOutImageCmd := strings.Split(strings.TrimSpace(outImageCmd), "\n") - c.Assert(splitOutImageCmd, checker.HasLen, 2) -} - // TestPullClientDisconnect kills the client during a pull operation and verifies that the operation // gets cancelled. //