mirror of
https://github.com/containers/podman.git
synced 2026-03-13 08:01:19 +08:00
test: remove redundant test for restoring with --publish without --import
Signed-off-by: MayorFaj <mayorfaj@gmail.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user