From ce5359f54ce0c2c74ddb198c87591796c0c70329 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 15 Feb 2022 12:31:20 -0600 Subject: Fix images since/after tests For the since and after imagve filter tests, instead of using the read-only cache of images, we just use the empty r/w store. We then build three images that are strictly predictable. Signed-off-by: Brent Baude --- test/e2e/images_test.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index 3a9f3f513..5492860b3 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -188,23 +188,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(len(result.OutputToStringArray())).To(Equal(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() { -- cgit v1.2.3-54-g00ecf From 2fd1ff9d1e49ed7105ab4cb2ccfe0cf9a9fcf98b Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 15 Feb 2022 15:21:00 -0600 Subject: Changes of docker descriptions It looks like some descriptions have changed on the docker registry where we had been searching for images that include 'alpine'. We are now seeing an image in the initial list that has 'alpine' in its description. Signed-off-by: Brent Baude --- test/python/docker/compat/test_images.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/python/docker/compat/test_images.py b/test/python/docker/compat/test_images.py index 1e2b531b7..4b1620faa 100644 --- a/test/python/docker/compat/test_images.py +++ b/test/python/docker/compat/test_images.py @@ -86,7 +86,8 @@ class TestImages(unittest.TestCase): 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""" -- cgit v1.2.3-54-g00ecf From 4fa7a2e3ae64b2b5d3f0fefd82fa1b6905e66f87 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Mon, 21 Feb 2022 10:54:04 -0500 Subject: Disable search-images test Found images being returned which do have "Alpine" in the description. However, test fails because podman truncates the field. Disabling test since this is a long-term maintenance branch. Signed-off-by: Chris Evich --- test/python/docker/compat/test_images.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/python/docker/compat/test_images.py b/test/python/docker/compat/test_images.py index 4b1620faa..cb3f84cec 100644 --- a/test/python/docker/compat/test_images.py +++ b/test/python/docker/compat/test_images.py @@ -83,11 +83,14 @@ class TestImages(unittest.TestCase): # List images with filter self.assertEqual(len(self.client.images.list(filters={"reference": "alpine"})), 1) - def test_search_image(self): - """Search for image""" - for r in self.client.images.search("alpine"): - # registry matches if string is in either one - self.assertIn("alpine", r["Name"]+" "+r["Description"].lower()) + # Disabled due to dependence on potentially unstable search results and + # failures because podman truncates image descriptions which otherwise + # would satisfy test condition. + #def test_search_image(self): + # """Search for image""" + # for r in self.client.images.search("alpine"): + # # 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""" -- cgit v1.2.3-54-g00ecf