summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorAdrian Reber <areber@redhat.com>2019-02-28 17:24:08 +0000
committerAdrian Reber <adrian@lisas.de>2019-03-01 08:08:55 +0100
commit43fe2bf064a4c7e7e24f35abd76acc5add6cc09a (patch)
treee11d7076521a0302b6385c55e7b20a728972a1f6 /test/e2e
parent5afae0b25bba4e2274747b32cf8b3bc929daf06e (diff)
downloadpodman-43fe2bf064a4c7e7e24f35abd76acc5add6cc09a.tar.gz
podman-43fe2bf064a4c7e7e24f35abd76acc5add6cc09a.tar.bz2
podman-43fe2bf064a4c7e7e24f35abd76acc5add6cc09a.zip
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>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/checkpoint_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go
index fda6eb085..ecf4e4841 100644
--- a/test/e2e/checkpoint_test.go
+++ b/test/e2e/checkpoint_test.go
@@ -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.")
}