Merge pull request #1230 from dmcgowan/snapshot-client-testsuite

snapshot: run test suite for metadata and client implementations
This commit is contained in:
Stephen Day
2017-07-27 15:49:17 -07:00
committed by GitHub
3 changed files with 77 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/containerd/containerd/fs/fstest"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/snapshot"
"github.com/containerd/containerd/testutil"
"github.com/stretchr/testify/assert"
@@ -27,6 +28,7 @@ func SnapshotterSuite(t *testing.T, name string, snapshotterFn func(ctx context.
func makeTest(t *testing.T, name string, snapshotterFn func(ctx context.Context, root string) (snapshot.Snapshotter, func(), error), fn func(ctx context.Context, t *testing.T, snapshotter snapshot.Snapshotter, work string)) func(t *testing.T) {
return func(t *testing.T) {
ctx := context.Background()
ctx = namespaces.WithNamespace(ctx, "testsuite")
restoreMask := clearMask()
defer restoreMask()
// Make two directories: a snapshotter root and a play area for the tests: