Merge pull request #13501 from vdemeester/8048-image-repository-tag
Fix #8048 : make `docker images repository:tag` work Upstream-commit: c6c195a465652e96b06e76b44a1df075cba9ad80 Component: engine
This commit is contained in:
@@ -18,6 +18,39 @@ func (s *DockerSuite) TestImagesEnsureImageIsListed(c *check.C) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestImagesEnsureImageWithTagIsListed(c *check.C) {
|
||||
_, err := buildImage("imagewithtag:v1",
|
||||
`FROM scratch
|
||||
MAINTAINER dockerio1`, true)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
_, err = buildImage("imagewithtag:v2",
|
||||
`FROM scratch
|
||||
MAINTAINER dockerio1`, true)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
out, _ := dockerCmd(c, "images", "imagewithtag:v1")
|
||||
|
||||
if !strings.Contains(out, "imagewithtag") || !strings.Contains(out, "v1") || strings.Contains(out, "v2") {
|
||||
c.Fatal("images should've listed imagewithtag:v1 and not imagewithtag:v2")
|
||||
}
|
||||
|
||||
out, _ = dockerCmd(c, "images", "imagewithtag")
|
||||
|
||||
if !strings.Contains(out, "imagewithtag") || !strings.Contains(out, "v1") || !strings.Contains(out, "v2") {
|
||||
c.Fatal("images should've listed imagewithtag:v1 and imagewithtag:v2")
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestImagesEnsureImageWithBadTagIsNotListed(c *check.C) {
|
||||
out, _ := dockerCmd(c, "images", "busybox:nonexistent")
|
||||
|
||||
if strings.Contains(out, "busybox") {
|
||||
c.Fatal("images should not have listed busybox")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestImagesOrderedByCreationDate(c *check.C) {
|
||||
id1, err := buildImage("order:test_a",
|
||||
`FROM scratch
|
||||
|
||||
Reference in New Issue
Block a user