integration-cli: fix TestPushMultipleTags

This test was meant to _push_ images, not _pull_ them

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-08-28 19:53:15 +02:00
parent 43ea03002f
commit 40b3edc81e
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 6 additions and 13 deletions

View File

@ -80,15 +80,13 @@ func testPushMultipleTags(c *testing.T) {
repoTag2 := fmt.Sprintf("%v/dockercli/busybox:t2", privateRegistryURL)
// tag the image and upload it to the private registry
dockerCmd(c, "tag", "busybox", repoTag1)
dockerCmd(c, "tag", "busybox", repoTag2)
dockerCmd(c, "push", repoName)
// Ensure layer list is equivalent for repoTag1 and repoTag2
out1, _ := dockerCmd(c, "pull", repoTag1)
imageAlreadyExists := ": Image already exists"
// Ensure layer list is equivalent for repoTag1 and repoTag2
out1, _ := dockerCmd(c, "push", repoTag1)
var out1Lines []string
for _, outputLine := range strings.Split(out1, "\n") {
if strings.Contains(outputLine, imageAlreadyExists) {
@ -96,19 +94,14 @@ func testPushMultipleTags(c *testing.T) {
}
}
out2, _ := dockerCmd(c, "pull", repoTag2)
out2, _ := dockerCmd(c, "push", repoTag2)
var out2Lines []string
for _, outputLine := range strings.Split(out2, "\n") {
if strings.Contains(outputLine, imageAlreadyExists) {
out1Lines = append(out1Lines, outputLine)
out2Lines = append(out2Lines, outputLine)
}
}
assert.Equal(c, len(out2Lines), len(out1Lines))
for i := range out1Lines {
assert.Equal(c, out1Lines[i], out2Lines[i])
}
assert.DeepEqual(c, out1Lines, out2Lines)
}
func (s *DockerRegistrySuite) TestPushMultipleTags(c *testing.T) {