mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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:
parent
43ea03002f
commit
40b3edc81e
1 changed files with 6 additions and 13 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue