diff options
Diffstat (limited to 'test/e2e/images_test.go')
-rw-r--r-- | test/e2e/images_test.go | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index 9cc04e6b0..efa9f399b 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -78,7 +78,7 @@ var _ = Describe("Podman images", func() { session = podmanTest.Podman([]string{"images", "-qn"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(len(session.OutputToStringArray())).To(BeNumerically("==", len(CACHE_IMAGES))) + Expect(session.OutputToStringArray()).To(HaveLen(len(CACHE_IMAGES))) }) It("podman images with digests", func() { @@ -125,7 +125,7 @@ var _ = Describe("Podman images", func() { session := podmanTest.Podman([]string{"images", "-q", ALPINE}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(len(session.OutputToStringArray())).To(Equal(1)) + Expect(session.OutputToStringArray()).To(HaveLen(1)) session = podmanTest.Podman([]string{"tag", ALPINE, "foo:a"}) session.WaitWithDefaultTimeout() @@ -137,31 +137,31 @@ var _ = Describe("Podman images", func() { session = podmanTest.Podman([]string{"images", "-q", "foo"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(len(session.OutputToStringArray())).To(Equal(2)) + Expect(session.OutputToStringArray()).To(HaveLen(2)) }) It("podman images filter reference", func() { result := podmanTest.Podman([]string{"images", "-q", "-f", "reference=quay.io*"}) result.WaitWithDefaultTimeout() Expect(result).Should(Exit(0)) - Expect(len(result.OutputToStringArray())).To(Equal(7)) + Expect(result.OutputToStringArray()).To(HaveLen(7)) retalpine := podmanTest.Podman([]string{"images", "-f", "reference=a*pine"}) retalpine.WaitWithDefaultTimeout() Expect(retalpine).Should(Exit(0)) - Expect(len(retalpine.OutputToStringArray())).To(Equal(6)) + Expect(retalpine.OutputToStringArray()).To(HaveLen(6)) Expect(retalpine.OutputToString()).To(ContainSubstring("alpine")) retalpine = podmanTest.Podman([]string{"images", "-f", "reference=alpine"}) retalpine.WaitWithDefaultTimeout() Expect(retalpine).Should(Exit(0)) - Expect(len(retalpine.OutputToStringArray())).To(Equal(6)) + Expect(retalpine.OutputToStringArray()).To(HaveLen(6)) Expect(retalpine.OutputToString()).To(ContainSubstring("alpine")) retnone := podmanTest.Podman([]string{"images", "-q", "-f", "reference=bogus"}) retnone.WaitWithDefaultTimeout() Expect(retnone).Should(Exit(0)) - Expect(len(retnone.OutputToStringArray())).To(Equal(0)) + Expect(retnone.OutputToStringArray()).To(BeEmpty()) }) It("podman images filter before image", func() { @@ -172,8 +172,7 @@ RUN apk update && apk add strace result := podmanTest.Podman([]string{"images", "-q", "-f", "before=foobar.com/before:latest"}) result.WaitWithDefaultTimeout() Expect(result).Should(Exit(0)) - Expect(len(result.OutputToStringArray()) >= 1).To(BeTrue()) - + Expect(len(result.OutputToStringArray())).To(BeNumerically(">=", 1)) }) It("podman images workingdir from image", func() { @@ -194,7 +193,7 @@ WORKDIR /test result := podmanTest.Podman([]string{"images", "-q", "-f", "since=quay.io/libpod/alpine:latest"}) result.WaitWithDefaultTimeout() Expect(result).Should(Exit(0)) - Expect(len(result.OutputToStringArray())).To(Equal(9)) + Expect(result.OutputToStringArray()).To(HaveLen(9)) }) It("podman image list filter after image", func() { @@ -326,12 +325,12 @@ ENV foo=bar session := podmanTest.Podman([]string{"images"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(len(session.OutputToStringArray())).To(Equal(len(CACHE_IMAGES) + 2)) + Expect(session.OutputToStringArray()).To(HaveLen(len(CACHE_IMAGES) + 2)) session2 := podmanTest.Podman([]string{"images", "--all"}) session2.WaitWithDefaultTimeout() Expect(session2).Should(Exit(0)) - Expect(len(session2.OutputToStringArray())).To(Equal(len(CACHE_IMAGES) + 4)) + Expect(session2.OutputToStringArray()).To(HaveLen(len(CACHE_IMAGES) + 4)) }) It("podman images filter by label", func() { @@ -343,7 +342,7 @@ LABEL "com.example.vendor"="Example Vendor" session := podmanTest.Podman([]string{"images", "-f", "label=version=1.0"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(len(session.OutputToStringArray())).To(Equal(2)) + Expect(session.OutputToStringArray()).To(HaveLen(2)) }) It("podman with images with no layers", func() { @@ -380,7 +379,7 @@ LABEL "com.example.vendor"="Example Vendor" session = podmanTest.Podman([]string{"history", "--quiet", "foo"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(len(session.OutputToStringArray())).To(Equal(6)) + Expect(session.OutputToStringArray()).To(HaveLen(6)) session = podmanTest.Podman([]string{"image", "list", "foo"}) session.WaitWithDefaultTimeout() @@ -437,11 +436,11 @@ RUN > file2 result := podmanTest.Podman([]string{"image", "prune", "--filter", "label=abc", "--force"}) result.WaitWithDefaultTimeout() Expect(result).Should(Exit(0)) - Expect(len(result.OutputToStringArray())).To(Equal(1)) + Expect(result.OutputToStringArray()).To(HaveLen(1)) //check if really abc is removed result = podmanTest.Podman([]string{"image", "list", "--filter", "label=abc"}) - Expect(len(result.OutputToStringArray())).To(Equal(0)) + Expect(result.OutputToStringArray()).To(BeEmpty()) }) @@ -458,11 +457,11 @@ RUN > file2 result := podmanTest.Podman([]string{"builder", "prune", "--filter", "label=abc", "--force"}) result.WaitWithDefaultTimeout() Expect(result).Should(Exit(0)) - Expect(len(result.OutputToStringArray())).To(Equal(1)) + Expect(result.OutputToStringArray()).To(HaveLen(1)) //check if really abc is removed result = podmanTest.Podman([]string{"image", "list", "--filter", "label=abc"}) - Expect(len(result.OutputToStringArray())).To(Equal(0)) + Expect(result.OutputToStringArray()).To(BeEmpty()) }) |