From 1aefd06760891004e712e430ac09043b228d3c02 Mon Sep 17 00:00:00 2001 From: MayorFaj Date: Mon, 16 Feb 2026 20:13:45 +0000 Subject: [PATCH] test: remove redundant test for restoring with --publish without --import Signed-off-by: MayorFaj --- test/e2e/checkpoint_test.go | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index 00d2bfbb08..e332c5f350 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -75,31 +75,6 @@ var _ = Describe("Podman checkpoint", func() { Expect(session).Should(ExitWithError(125, "no such container or image")) }) - It("podman restore --publish without --import should fail", func() { - localRunString := getRunString([]string{ALPINE, "top"}) - session := podmanTest.Podman(localRunString) - session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) - cid := session.OutputToString() - - result := podmanTest.Podman([]string{"container", "checkpoint", cid}) - result.WaitWithDefaultTimeout() - Expect(result).Should(ExitCleanly()) - - result = podmanTest.Podman([]string{"container", "restore", "-p", "8080:8080", cid}) - result.WaitWithDefaultTimeout() - Expect(result).Should(ExitWithError(125, "--publish can only be used with image or --import")) - - // Clean up - result = podmanTest.Podman([]string{"container", "restore", cid}) - result.WaitWithDefaultTimeout() - Expect(result).Should(ExitCleanly()) - - result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"}) - result.WaitWithDefaultTimeout() - Expect(result).Should(ExitCleanly()) - }) - It("podman checkpoint a running container by id", func() { localRunString := getRunString([]string{ALPINE, "top"}) session := podmanTest.Podman(localRunString) @@ -144,6 +119,11 @@ var _ = Describe("Podman checkpoint", func() { Expect(inspectOut[0].State.CheckpointLog).To(ContainSubstring("userdata/dump.log")) Expect(inspectOut[0].State).To(HaveField("RestoreLog", "")) + // Restoring with --publish should fail without --import (#28031) + result = podmanTest.Podman([]string{"container", "restore", "-p", "8080:8080", cid}) + result.WaitWithDefaultTimeout() + Expect(result).Should(ExitWithError(125, "--publish can only be used with image or --import")) + result = podmanTest.Podman([]string{ "container", "restore",