|
@@ -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
|