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

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