From 9be4a525f459c513c9a1cdb22bc46db205132657 Mon Sep 17 00:00:00 2001 From: Alex Jia Date: Wed, 22 Mar 2023 22:00:37 +0800 Subject: [PATCH] test: podman checkpoint/restore the latest container Signed-off-by: Alex Jia --- test/system/520-checkpoint.bats | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/system/520-checkpoint.bats b/test/system/520-checkpoint.bats index dc49871749..62281412d9 100644 --- a/test/system/520-checkpoint.bats +++ b/test/system/520-checkpoint.bats @@ -403,4 +403,27 @@ function teardown() { run_podman network rm $netname } +# rhbz#2177611 : podman breaks checkpoint/restore +@test "podman checkpoint/restore the latest container" { + skip_if_remote "podman-remote does not support --latest option" + # checkpoint/restore -l must print the IDs + run_podman run -d $IMAGE top + ctrID="$output" + run_podman container checkpoint --latest + is "$output" "$ctrID" + + run_podman container inspect \ + --format '{{.State.Status}}:{{.State.Running}}:{{.State.Paused}}:{{.State.Checkpointed}}' $ctrID + is "$output" "exited:false:false:true" "State. Status:Running:Pause:Checkpointed" + + run_podman container restore -l + is "$output" "$ctrID" + + run_podman container inspect \ + --format '{{.State.Status}}:{{.State.Running}}:{{.State.Paused}}:{{.State.Checkpointed}}' $ctrID + is "$output" "running:true:false:false" "State. Status:Running:Pause:Checkpointed" + + run_podman rm -t 0 -f $ctrID +} + # vim: filetype=sh