From 02e250f3d2a6ace8bdaea9dbdb7bba2751d35eff Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Fri, 7 Apr 2023 02:09:18 +0530 Subject: [PATCH] "podman pull by digest and list --all" test: untag instead of rmi The "podman pull by digest and list --all" e2e test pulls an image using a tagged reference when an image with the same ID is already present in a read-only additional image store. This causes a new image record to be created in read-write storage. The test then removes this entry, pulls the image again using a digested reference, and then expects the image to not have any tagged names in it when it goes to look at it again. Newer containers/storage will ensure that at the point when the read-write image record is created, that it includes all of the data items and naming information from the read-only copy of the image, so that this information doesn't appear to be lost. Change the test to use "untag" instead of "rmi", which should pass with either the older or newer containers/storage. The test is checking that `podman images` doesn't choke when it encounters a digested name attached to an image, so the difference in behavior between containers/storage versions is irrelevant. Signed-off-by: Nalin Dahyabhai (cherry picked from commit a428555e3ef2d8cccb5c3650044e923663a796e0) Signed-off-by: Lokesh Mandvekar --- test/e2e/images_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index a4c277fbb7..ef7d5fad85 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -217,7 +217,8 @@ WORKDIR /test }) It("podman pull by digest and list --all", func() { - // Prevent regressing on issue #7651. + // Prevent regressing on issue #7651: error parsing name that includes a digest + // component as if were a name that includes tag component. digestPullAndList := func(noneTag bool) { session := podmanTest.Podman([]string{"pull", ALPINEAMD64DIGEST}) session.WaitWithDefaultTimeout() @@ -233,14 +234,18 @@ WORKDIR /test Expect(result.OutputToString()).To(Not(ContainSubstring(""))) } } - // No "" tag as tagged alpine instances should be present. + // No "" in the tag column as image tagged as "ALPINE" should be present in + // the additional image store we're using. Pull the same image by another name to + // copy an entry for the image into read-write storage so that the name can be + // attached to it. session := podmanTest.Podman([]string{"pull", ALPINELISTTAG}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) digestPullAndList(false) - // Now remove all images, re-pull by digest and check for the "" tag. - session = podmanTest.Podman([]string{"rmi", "-af"}) + // Now remove all names from the read-write image record, re-pull by digest and + // check for the "" in its listing. + session = podmanTest.Podman([]string{"untag", ALPINELISTTAG}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0))