integration: Enable some tests for Windows (part 2)

Some of the tests that are currently running only on Linux can be made
to run on Windows with a few changes.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
This commit is contained in:
Claudiu Belu
2021-10-12 11:27:43 +03:00
parent d97b40c300
commit 830b3c26ec
8 changed files with 440 additions and 402 deletions

View File

@@ -23,6 +23,7 @@ import (
"context"
"fmt"
"github.com/containerd/containerd/cio"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/oci"
specs "github.com/opencontainers/runtime-spec/specs-go"
@@ -56,3 +57,15 @@ func withExecExitStatus(s *specs.Process, es int) {
func withExecArgs(s *specs.Process, args ...string) {
s.Args = args
}
func newDirectIO(ctx context.Context, terminal bool) (*directIO, error) {
fifos, err := cio.NewFIFOSetInDir("", "", terminal)
if err != nil {
return nil, err
}
dio, err := cio.NewDirectIO(ctx, fifos)
if err != nil {
return nil, err
}
return &directIO{DirectIO: *dio}, nil
}