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 <Paul.Hampson@Pobox.com>
This commit is contained in:
Paul "TBBle" Hampson 2020-12-13 21:49:03 +11:00 committed by Gabriel Adrian Samfira
parent 469c13997a
commit 909730decb
2 changed files with 16 additions and 0 deletions

View File

@ -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),

View File

@ -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)