summaryrefslogtreecommitdiff
path: root/integration-cli/docker_cli_push_test.go
diff options
context:
space:
mode:
authorJessie Frazelle <jfrazelle@users.noreply.github.com>2015-08-12 20:19:06 -0700
committerJessie Frazelle <jfrazelle@users.noreply.github.com>2015-08-12 20:19:06 -0700
commitb66e5ef20824ecef46d657833db409a035b65306 (patch)
tree141c1eb26f46b3bb114f28b561a34fe773586d59 /integration-cli/docker_cli_push_test.go
parentb0e0dbb33b4a188a04cbef8dbc405ea86dfd6cd5 (diff)
parentd12ea79c9de6d144ce6bc7ccfe41c507cca6fd35 (diff)
downloaddocker-release.tar.gz
Merge pull request #15544 from icecrime/bump_1.8.1release
Bump 1.8.1
Diffstat (limited to 'integration-cli/docker_cli_push_test.go')
-rw-r--r--integration-cli/docker_cli_push_test.go49
1 files changed, 29 insertions, 20 deletions
diff --git a/integration-cli/docker_cli_push_test.go b/integration-cli/docker_cli_push_test.go
index ed4d24a856..111e9f33d3 100644
--- a/integration-cli/docker_cli_push_test.go
+++ b/integration-cli/docker_cli_push_test.go
@@ -60,31 +60,40 @@ func (s *DockerRegistrySuite) TestPushMultipleTags(c *check.C) {
dockerCmd(c, "tag", "busybox", repoTag2)
- out, _ := dockerCmd(c, "push", repoName)
+ dockerCmd(c, "push", repoName)
- // There should be no duplicate hashes in the output
- imageSuccessfullyPushed := ": Image successfully pushed"
+ // Ensure layer list is equivalent for repoTag1 and repoTag2
+ out1, _ := dockerCmd(c, "pull", repoTag1)
+ if strings.Contains(out1, "Tag t1 not found") {
+ c.Fatalf("Unable to pull pushed image: %s", out1)
+ }
imageAlreadyExists := ": Image already exists"
- imagePushHashes := make(map[string]struct{})
- outputLines := strings.Split(out, "\n")
- for _, outputLine := range outputLines {
- if strings.Contains(outputLine, imageSuccessfullyPushed) {
- hash := strings.TrimSuffix(outputLine, imageSuccessfullyPushed)
- if _, present := imagePushHashes[hash]; present {
- c.Fatalf("Duplicate image push: %s", outputLine)
- }
- imagePushHashes[hash] = struct{}{}
- } else if strings.Contains(outputLine, imageAlreadyExists) {
- hash := strings.TrimSuffix(outputLine, imageAlreadyExists)
- if _, present := imagePushHashes[hash]; present {
- c.Fatalf("Duplicate image push: %s", outputLine)
- }
- imagePushHashes[hash] = struct{}{}
+ var out1Lines []string
+ for _, outputLine := range strings.Split(out1, "\n") {
+ if strings.Contains(outputLine, imageAlreadyExists) {
+ out1Lines = append(out1Lines, outputLine)
}
}
- if len(imagePushHashes) == 0 {
- c.Fatal(`Expected at least one line containing "Image successfully pushed"`)
+ out2, _ := dockerCmd(c, "pull", repoTag2)
+ if strings.Contains(out2, "Tag t2 not found") {
+ c.Fatalf("Unable to pull pushed image: %s", out1)
+ }
+ var out2Lines []string
+ for _, outputLine := range strings.Split(out2, "\n") {
+ if strings.Contains(outputLine, imageAlreadyExists) {
+ out1Lines = append(out1Lines, outputLine)
+ }
+ }
+
+ if len(out1Lines) != len(out2Lines) {
+ c.Fatalf("Mismatched output length:\n%s\n%s", out1, out2)
+ }
+
+ for i := range out1Lines {
+ if out1Lines[i] != out2Lines[i] {
+ c.Fatalf("Mismatched output line:\n%s\n%s", out1Lines[i], out2Lines[i])
+ }
}
}