Skip to content

Commit 3cdcb2f

Browse files
TBBlegabriel-samfira
authored andcommitted
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 <[email protected]>
1 parent b0968b8 commit 3cdcb2f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

snapshots/testsuite/issues.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package testsuite
1919
import (
2020
"context"
2121
"fmt"
22+
"runtime"
2223
"strings"
2324
"testing"
2425
"time"
@@ -94,6 +95,9 @@ func checkRemoveDirectoryInLowerLayer(ctx context.Context, t *testing.T, sn snap
9495
// See https://github.com/docker/docker/issues/24913 overlay
9596
// see https://github.com/docker/docker/issues/28391 overlay2
9697
func checkChown(ctx context.Context, t *testing.T, sn snapshots.Snapshotter, work string) {
98+
if runtime.GOOS == "windows" {
99+
t.Skip("Chown is not supported on WCOW")
100+
}
97101
l1Init := fstest.Apply(
98102
fstest.CreateDir("/opt", 0700),
99103
fstest.CreateDir("/opt/a", 0700),
@@ -153,6 +157,9 @@ func checkRename(ss string) func(ctx context.Context, t *testing.T, sn snapshots
153157
// checkDirectoryPermissionOnCommit
154158
// https://github.com/docker/docker/issues/27298
155159
func checkDirectoryPermissionOnCommit(ctx context.Context, t *testing.T, sn snapshots.Snapshotter, work string) {
160+
if runtime.GOOS == "windows" {
161+
t.Skip("Chown is not supported on WCOW")
162+
}
156163
l1Init := fstest.Apply(
157164
fstest.CreateDir("/dir1", 0700),
158165
fstest.CreateDir("/dir2", 0700),

snapshots/testsuite/testsuite.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"fmt"
2424
"os"
2525
"path/filepath"
26+
"runtime"
2627
"sort"
2728
"testing"
2829
"time"
@@ -795,6 +796,10 @@ func checkRemove(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsh
795796
// checkSnapshotterViewReadonly ensures a KindView snapshot to be mounted as a read-only filesystem.
796797
// This function is called only when WithTestViewReadonly is true.
797798
func checkSnapshotterViewReadonly(ctx context.Context, t *testing.T, snapshotter snapshots.Snapshotter, work string) {
799+
if runtime.GOOS == "windows" {
800+
t.Skip("Read-only protection on views is not supported on WCOW")
801+
}
802+
798803
preparing := filepath.Join(work, "preparing")
799804
if _, err := snapshotter.Prepare(ctx, preparing, "", opt); err != nil {
800805
t.Fatal(err)
@@ -875,6 +880,10 @@ func closeTwice(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsho
875880
}
876881

877882
func checkRootPermission(ctx context.Context, t *testing.T, snapshotter snapshots.Snapshotter, work string) {
883+
if runtime.GOOS == "windows" {
884+
t.Skip("Filesystem permissions are not supported on WCOW")
885+
}
886+
878887
preparing, err := snapshotterPrepareMount(ctx, snapshotter, "preparing", "", work)
879888
if err != nil {
880889
t.Fatal(err)

0 commit comments

Comments
 (0)