From 909730decb1fe906ec59825adb64f1be59b17fb5 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Sun, 13 Dec 2020 21:49:03 +1100 Subject: [PATCH] Skip tests that do not apply to WCOW on Windows Filesystem permissions and ownership are not modifiable via an image mount. Signed-off-by: Paul "TBBle" Hampson --- snapshots/testsuite/issues.go | 7 +++++++ snapshots/testsuite/testsuite.go | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/snapshots/testsuite/issues.go b/snapshots/testsuite/issues.go index eea87767e..92a04526e 100644 --- a/snapshots/testsuite/issues.go +++ b/snapshots/testsuite/issues.go @@ -19,6 +19,7 @@ package testsuite import ( "context" "fmt" + "runtime" "strings" "testing" "time" @@ -94,6 +95,9 @@ func checkRemoveDirectoryInLowerLayer(ctx context.Context, t *testing.T, sn snap // See https://github.com/docker/docker/issues/24913 overlay // see https://github.com/docker/docker/issues/28391 overlay2 func checkChown(ctx context.Context, t *testing.T, sn snapshots.Snapshotter, work string) { + if runtime.GOOS == "windows" { + t.Skip("Chown is not supported on WCOW") + } l1Init := fstest.Apply( fstest.CreateDir("/opt", 0700), fstest.CreateDir("/opt/a", 0700), @@ -147,6 +151,9 @@ func checkRename(ss string) func(ctx context.Context, t *testing.T, sn snapshots // checkDirectoryPermissionOnCommit // https://github.com/docker/docker/issues/27298 func checkDirectoryPermissionOnCommit(ctx context.Context, t *testing.T, sn snapshots.Snapshotter, work string) { + if runtime.GOOS == "windows" { + t.Skip("Chown is not supported on WCOW") + } l1Init := fstest.Apply( fstest.CreateDir("/dir1", 0700), fstest.CreateDir("/dir2", 0700), diff --git a/snapshots/testsuite/testsuite.go b/snapshots/testsuite/testsuite.go index eec4fa82f..ffdbae93e 100644 --- a/snapshots/testsuite/testsuite.go +++ b/snapshots/testsuite/testsuite.go @@ -23,6 +23,7 @@ import ( "fmt" "os" "path/filepath" + "runtime" "sort" "testing" "time" @@ -795,6 +796,10 @@ func checkRemove(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsh // checkSnapshotterViewReadonly ensures a KindView snapshot to be mounted as a read-only filesystem. // This function is called only when WithTestViewReadonly is true. func checkSnapshotterViewReadonly(ctx context.Context, t *testing.T, snapshotter snapshots.Snapshotter, work string) { + if runtime.GOOS == "windows" { + t.Skip("Read-only protection on views is not supported on WCOW") + } + preparing := filepath.Join(work, "preparing") if _, err := snapshotter.Prepare(ctx, preparing, "", opt); err != nil { t.Fatal(err) @@ -875,6 +880,10 @@ func closeTwice(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsho } func checkRootPermission(ctx context.Context, t *testing.T, snapshotter snapshots.Snapshotter, work string) { + if runtime.GOOS == "windows" { + t.Skip("Filesystem permissions are not supported on WCOW") + } + preparing, err := snapshotterPrepareMount(ctx, snapshotter, "preparing", "", work) if err != nil { t.Fatal(err)