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:
parent
469c13997a
commit
909730decb
@ -19,6 +19,7 @@ package testsuite
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"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/24913 overlay
|
||||||
// see https://github.com/docker/docker/issues/28391 overlay2
|
// see https://github.com/docker/docker/issues/28391 overlay2
|
||||||
func checkChown(ctx context.Context, t *testing.T, sn snapshots.Snapshotter, work string) {
|
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(
|
l1Init := fstest.Apply(
|
||||||
fstest.CreateDir("/opt", 0700),
|
fstest.CreateDir("/opt", 0700),
|
||||||
fstest.CreateDir("/opt/a", 0700),
|
fstest.CreateDir("/opt/a", 0700),
|
||||||
@ -147,6 +151,9 @@ func checkRename(ss string) func(ctx context.Context, t *testing.T, sn snapshots
|
|||||||
// checkDirectoryPermissionOnCommit
|
// checkDirectoryPermissionOnCommit
|
||||||
// https://github.com/docker/docker/issues/27298
|
// https://github.com/docker/docker/issues/27298
|
||||||
func checkDirectoryPermissionOnCommit(ctx context.Context, t *testing.T, sn snapshots.Snapshotter, work string) {
|
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(
|
l1Init := fstest.Apply(
|
||||||
fstest.CreateDir("/dir1", 0700),
|
fstest.CreateDir("/dir1", 0700),
|
||||||
fstest.CreateDir("/dir2", 0700),
|
fstest.CreateDir("/dir2", 0700),
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"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.
|
// checkSnapshotterViewReadonly ensures a KindView snapshot to be mounted as a read-only filesystem.
|
||||||
// This function is called only when WithTestViewReadonly is true.
|
// This function is called only when WithTestViewReadonly is true.
|
||||||
func checkSnapshotterViewReadonly(ctx context.Context, t *testing.T, snapshotter snapshots.Snapshotter, work string) {
|
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")
|
preparing := filepath.Join(work, "preparing")
|
||||||
if _, err := snapshotter.Prepare(ctx, preparing, "", opt); err != nil {
|
if _, err := snapshotter.Prepare(ctx, preparing, "", opt); err != nil {
|
||||||
t.Fatal(err)
|
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) {
|
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)
|
preparing, err := snapshotterPrepareMount(ctx, snapshotter, "preparing", "", work)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user