Runtime v2

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-07-09 13:27:52 -04:00
parent 6de11ab973
commit da1b5470cd
78 changed files with 9836 additions and 652 deletions

View File

@@ -28,6 +28,8 @@ import (
"testing"
"github.com/containerd/containerd/oci"
"github.com/containerd/containerd/runtime/linux/runctypes"
"github.com/containerd/containerd/runtime/v2/runc/options"
)
func TestCheckpointRestorePTY(t *testing.T) {
@@ -81,7 +83,7 @@ func TestCheckpointRestorePTY(t *testing.T) {
t.Fatal(err)
}
checkpoint, err := task.Checkpoint(ctx, WithExit)
checkpoint, err := task.Checkpoint(ctx, withExit(client))
if err != nil {
t.Fatal(err)
}
@@ -176,7 +178,7 @@ func TestCheckpointRestore(t *testing.T) {
t.Fatal(err)
}
checkpoint, err := task.Checkpoint(ctx, WithExit)
checkpoint, err := task.Checkpoint(ctx, withExit(client))
if err != nil {
t.Fatal(err)
}
@@ -245,7 +247,7 @@ func TestCheckpointRestoreNewContainer(t *testing.T) {
t.Fatal(err)
}
checkpoint, err := task.Checkpoint(ctx, WithExit)
checkpoint, err := task.Checkpoint(ctx, withExit(client))
if err != nil {
t.Fatal(err)
}
@@ -343,3 +345,19 @@ func TestCheckpointLeaveRunning(t *testing.T) {
<-statusC
}
func withExit(client *Client) CheckpointTaskOpts {
return func(r *CheckpointTaskInfo) error {
switch client.runtime {
case "io.containerd.runc.v1":
r.Options = &options.CheckpointOptions{
Exit: true,
}
default:
r.Options = &runctypes.CheckpointOptions{
Exit: true,
}
}
return nil
}
}