summaryrefslogtreecommitdiff
path: root/test/e2e/images_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/images_test.go')
-rw-r--r--test/e2e/images_test.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index 4c7c93e4b..ecc0f2415 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -37,6 +37,15 @@ var _ = Describe("Podman images", func() {
Expect(session.LineInOuputStartsWith("docker.io/library/busybox")).To(BeTrue())
})
+ It("podman images with digests", func() {
+ session := podmanTest.Podman([]string{"images", "--digests"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 2))
+ Expect(session.LineInOuputStartsWith("docker.io/library/alpine")).To(BeTrue())
+ Expect(session.LineInOuputStartsWith("docker.io/library/busybox")).To(BeTrue())
+ })
+
It("podman images in JSON format", func() {
session := podmanTest.Podman([]string{"images", "--format=json"})
session.WaitWithDefaultTimeout()
@@ -44,10 +53,58 @@ var _ = Describe("Podman images", func() {
Expect(session.IsJSONOutputValid()).To(BeTrue())
})
+ It("podman images in GO template format", func() {
+ session := podmanTest.Podman([]string{"images", "--format={{.ID}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
+
It("podman images with short options", func() {
session := podmanTest.Podman([]string{"images", "-qn"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 1))
})
+
+ It("podman images filter by image name", func() {
+ session := podmanTest.Podman([]string{"images", "-q", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(1))
+ })
+
+ It("podman images filter before image", func() {
+ dockerfile := `FROM docker.io/library/alpine:latest
+`
+ podmanTest.BuildImage(dockerfile, "foobar.com/before:latest")
+ result := podmanTest.Podman([]string{"images", "-q", "-f", "before=foobar.com/before:latest"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(len(result.OutputToStringArray())).To(Equal(2))
+ })
+
+ It("podman images filter after image", func() {
+ rmi := podmanTest.Podman([]string{"rmi", "busybox"})
+ rmi.WaitWithDefaultTimeout()
+ Expect(rmi.ExitCode()).To(Equal(0))
+
+ dockerfile := `FROM docker.io/library/alpine:latest
+`
+ podmanTest.BuildImage(dockerfile, "foobar.com/before:latest")
+ result := podmanTest.Podman([]string{"images", "-q", "-f", "after=docker.io/library/alpine:latest"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(len(result.OutputToStringArray())).To(Equal(1))
+ })
+
+ It("podman images filter dangling", func() {
+ dockerfile := `FROM docker.io/library/alpine:latest
+`
+ podmanTest.BuildImage(dockerfile, "foobar.com/before:latest")
+ podmanTest.BuildImage(dockerfile, "foobar.com/before:latest")
+ result := podmanTest.Podman([]string{"images", "-q", "-f", "dangling=true"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(len(result.OutputToStringArray())).To(Equal(1))
+ })
})