Skip to content

Commit

Permalink
Merge pull request #13239 from baude/e2esincebefore
Browse files Browse the repository at this point in the history
Fix images since/after tests
  • Loading branch information
openshift-merge-robot authored Feb 16, 2022
2 parents 60b0acb + 6a8d29e commit 98962a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
20 changes: 12 additions & 8 deletions test/e2e/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,23 +187,27 @@ WORKDIR /test
})

It("podman images filter since image", func() {
dockerfile := `FROM quay.io/libpod/alpine:latest
dockerfile := `FROM scratch
`
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
result := podmanTest.Podman([]string{"images", "-q", "-f", "since=quay.io/libpod/alpine: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.PodmanNoCache([]string{"images", "-q", "-f", "since=foobar.com/one:latest"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result.OutputToStringArray()).To(HaveLen(9))
Expect(result.OutputToStringArray()).To(HaveLen(2))
})

It("podman image list filter after image", func() {
dockerfile := `FROM quay.io/libpod/alpine:latest
dockerfile := `FROM scratch
`
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
result := podmanTest.Podman([]string{"image", "list", "-q", "-f", "after=quay.io/libpod/alpine: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()
Expect(result).Should(Exit(0))
Expect(result.OutputToStringArray()).Should(HaveLen(9), "list filter output: %q", result.OutputToString())
Expect(result.OutputToStringArray()).Should(HaveLen(2), "list filter output: %q", result.OutputToString())
})

It("podman images filter dangling", func() {
Expand Down
3 changes: 2 additions & 1 deletion test/python/docker/compat/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def test_list_images(self):
def test_search_image(self):
"""Search for image"""
for r in self.client.images.search("alpine"):
self.assertIn("alpine", r["Name"])
# registry matches if string is in either one
self.assertIn("alpine", r["Name"]+" "+r["Description"].lower())

def test_search_bogus_image(self):
"""Search for bogus image should throw exception"""
Expand Down

0 comments on commit 98962a2

Please sign in to comment.