From e4992fb8185bba20fbcf729a77fb4de6f9443278 Mon Sep 17 00:00:00 2001 From: Toshiki Sonoda Date: Tue, 26 Jul 2022 10:00:52 +0900 Subject: Fix: Restore a container which name is equal to a image name If there is a match for both container and image, we restore the container. Fixes: https://github.com/containers/podman/issues/15055 Signed-off-by: Toshiki Sonoda --- test/e2e/checkpoint_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/e2e') diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index d1771f336..8f5e1a0b6 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -223,6 +223,26 @@ var _ = Describe("Podman checkpoint", func() { Expect(result).Should(Exit(0)) Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1)) Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Up")) + + // Restore a container which name is equal to a image name (#15055) + localRunString = getRunString([]string{"--name", "alpine", "quay.io/libpod/alpine:latest", "top"}) + session = podmanTest.Podman(localRunString) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + result = podmanTest.Podman([]string{"container", "checkpoint", "alpine"}) + result.WaitWithDefaultTimeout() + + Expect(result).Should(Exit(0)) + Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1)) + Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Exited")) + + result = podmanTest.Podman([]string{"container", "restore", "alpine"}) + result.WaitWithDefaultTimeout() + + Expect(result).Should(Exit(0)) + Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2)) + Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Up")) }) It("podman pause a checkpointed container by id", func() { -- cgit v1.2.3-54-g00ecf