e2e: merge after/since image-filter tests

Merge the two tests to speed up testing.  Both built the exact same
images.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2022-02-16 10:33:57 +01:00
parent 98962a28f5
commit b62816578e

View File

@ -186,25 +186,21 @@ WORKDIR /test
Expect(result.OutputToString()).To(Equal("/test")) Expect(result.OutputToString()).To(Equal("/test"))
}) })
It("podman images filter since image", func() { It("podman images filter since/after image", func() {
dockerfile := `FROM scratch dockerfile := `FROM scratch
` `
podmanTest.BuildImage(dockerfile, "foobar.com/one:latest", "false") podmanTest.BuildImage(dockerfile, "foobar.com/one:latest", "false")
podmanTest.BuildImage(dockerfile, "foobar.com/two:latest", "false") podmanTest.BuildImage(dockerfile, "foobar.com/two:latest", "false")
podmanTest.BuildImage(dockerfile, "foobar.com/three:latest", "false") podmanTest.BuildImage(dockerfile, "foobar.com/three:latest", "false")
// `since` filter
result := podmanTest.PodmanNoCache([]string{"images", "-q", "-f", "since=foobar.com/one:latest"}) result := podmanTest.PodmanNoCache([]string{"images", "-q", "-f", "since=foobar.com/one:latest"})
result.WaitWithDefaultTimeout() result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0)) Expect(result).Should(Exit(0))
Expect(result.OutputToStringArray()).To(HaveLen(2)) Expect(result.OutputToStringArray()).To(HaveLen(2))
})
It("podman image list filter after image", func() { // `after` filter
dockerfile := `FROM scratch result = podmanTest.Podman([]string{"image", "list", "-q", "-f", "after=foobar.com/one:latest"})
`
podmanTest.BuildImage(dockerfile, "foobar.com/one:latest", "false")
podmanTest.BuildImage(dockerfile, "foobar.com/two:latest", "false")
podmanTest.BuildImage(dockerfile, "foobar.com/three:latest", "false")
result := podmanTest.Podman([]string{"image", "list", "-q", "-f", "after=foobar.com/one:latest"})
result.WaitWithDefaultTimeout() result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0)) Expect(result).Should(Exit(0))
Expect(result.OutputToStringArray()).Should(HaveLen(2), "list filter output: %q", result.OutputToString()) Expect(result.OutputToStringArray()).Should(HaveLen(2), "list filter output: %q", result.OutputToString())