mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
Verify that used OCI runtime supports checkpoint
To be able to use OCI runtimes which do not implement checkpoint/restore this adds a check to the checkpoint code path and the checkpoint/restore tests to see if it knows about the checkpoint subcommand. If the used OCI runtime does not implement checkpoint/restore the tests are skipped and the actual 'podman container checkpoint' returns an error. Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
committed by
Adrian Reber
parent
5afae0b25b
commit
43fe2bf064
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/containers/libpod/pkg/criu"
|
||||
. "github.com/containers/libpod/test/utils"
|
||||
@@ -27,6 +28,16 @@ var _ = Describe("Podman checkpoint", func() {
|
||||
}
|
||||
podmanTest = PodmanTestCreate(tempdir)
|
||||
podmanTest.RestoreAllArtifacts()
|
||||
// Check if the runtime implements checkpointing. Currently only
|
||||
// runc's checkpoint/restore implementation is supported.
|
||||
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "-h")
|
||||
if err := cmd.Start(); err != nil {
|
||||
Skip("OCI runtime does not support checkpoint/restore")
|
||||
}
|
||||
if err := cmd.Wait(); err != nil {
|
||||
Skip("OCI runtime does not support checkpoint/restore")
|
||||
}
|
||||
|
||||
if !criu.CheckForCriu() {
|
||||
Skip("CRIU is missing or too old.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user