|
@@ -3,7 +3,6 @@ package main
|
|
import (
|
|
import (
|
|
"fmt"
|
|
"fmt"
|
|
"regexp"
|
|
"regexp"
|
|
- "runtime"
|
|
|
|
"strings"
|
|
"strings"
|
|
"sync"
|
|
"sync"
|
|
"time"
|
|
"time"
|
|
@@ -194,30 +193,26 @@ func (s *DockerHubPullSuite) TestPullScratchNotAllowed(c *check.C) {
|
|
// results in more images than a naked pull.
|
|
// results in more images than a naked pull.
|
|
func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *check.C) {
|
|
func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *check.C) {
|
|
testRequires(c, DaemonIsLinux)
|
|
testRequires(c, DaemonIsLinux)
|
|
- s.Cmd(c, "pull", "busybox")
|
|
|
|
- outImageCmd := s.Cmd(c, "images", "busybox")
|
|
|
|
|
|
+ s.Cmd(c, "pull", "dockercore/engine-pull-all-test-fixture")
|
|
|
|
+ outImageCmd := s.Cmd(c, "images", "dockercore/engine-pull-all-test-fixture")
|
|
splitOutImageCmd := strings.Split(strings.TrimSpace(outImageCmd), "\n")
|
|
splitOutImageCmd := strings.Split(strings.TrimSpace(outImageCmd), "\n")
|
|
c.Assert(splitOutImageCmd, checker.HasLen, 2)
|
|
c.Assert(splitOutImageCmd, checker.HasLen, 2)
|
|
|
|
|
|
- s.Cmd(c, "pull", "--all-tags=true", "busybox")
|
|
|
|
- outImageAllTagCmd := s.Cmd(c, "images", "busybox")
|
|
|
|
|
|
+ s.Cmd(c, "pull", "--all-tags=true", "dockercore/engine-pull-all-test-fixture")
|
|
|
|
+ outImageAllTagCmd := s.Cmd(c, "images", "dockercore/engine-pull-all-test-fixture")
|
|
linesCount := strings.Count(outImageAllTagCmd, "\n")
|
|
linesCount := strings.Count(outImageAllTagCmd, "\n")
|
|
c.Assert(linesCount, checker.GreaterThan, 2, check.Commentf("pulling all tags should provide more than two images, got %s", outImageAllTagCmd))
|
|
c.Assert(linesCount, checker.GreaterThan, 2, check.Commentf("pulling all tags should provide more than two images, got %s", outImageAllTagCmd))
|
|
|
|
|
|
- // Verify that the line for 'busybox:latest' is left unchanged.
|
|
|
|
|
|
+ // Verify that the line for 'dockercore/engine-pull-all-test-fixture:latest' is left unchanged.
|
|
var latestLine string
|
|
var latestLine string
|
|
for _, line := range strings.Split(outImageAllTagCmd, "\n") {
|
|
for _, line := range strings.Split(outImageAllTagCmd, "\n") {
|
|
- if strings.HasPrefix(line, "busybox") && strings.Contains(line, "latest") {
|
|
|
|
|
|
+ if strings.HasPrefix(line, "dockercore/engine-pull-all-test-fixture") && strings.Contains(line, "latest") {
|
|
latestLine = line
|
|
latestLine = line
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ c.Assert(latestLine, checker.Not(checker.Equals), "", check.Commentf("no entry for dockercore/engine-pull-all-test-fixture:latest found after pulling all tags"))
|
|
|
|
|
|
- if runtime.GOARCH == "amd64" {
|
|
|
|
- c.Assert(latestLine, checker.Not(checker.Equals), "", check.Commentf("no entry for busybox:latest found after pulling all tags"))
|
|
|
|
- } else {
|
|
|
|
- c.Assert(latestLine, checker.Not(checker.Contains), "", check.Commentf("no matching manifest"))
|
|
|
|
- }
|
|
|
|
splitLatest := strings.Fields(latestLine)
|
|
splitLatest := strings.Fields(latestLine)
|
|
splitCurrent := strings.Fields(splitOutImageCmd[1])
|
|
splitCurrent := strings.Fields(splitOutImageCmd[1])
|
|
|
|
|
|
@@ -233,7 +228,7 @@ func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *check.C) {
|
|
splitCurrent[4] = ""
|
|
splitCurrent[4] = ""
|
|
splitCurrent[5] = ""
|
|
splitCurrent[5] = ""
|
|
|
|
|
|
- c.Assert(splitLatest, checker.DeepEquals, splitCurrent, check.Commentf("busybox:latest was changed after pulling all tags"))
|
|
|
|
|
|
+ c.Assert(splitLatest, checker.DeepEquals, splitCurrent, check.Commentf("dockercore/engine-pull-all-test-fixture:latest was changed after pulling all tags"))
|
|
}
|
|
}
|
|
|
|
|
|
// TestPullClientDisconnect kills the client during a pull operation and verifies that the operation
|
|
// TestPullClientDisconnect kills the client during a pull operation and verifies that the operation
|