containerd/snapshot_test.go
Derek McGowan 750771f6d0
Remove snapshot test suite as a parallel test runner
The testsuite alters global state by setting the umask, avoid
running the testsuite in parallel and move umask manipulation
to the test suite level to individual tests may run in parallel.

Added better error messaging and handling.

Removed reliance on testing object for handling cleanup failure.
When a cleanup error occurred, it would fail the test but the log
would get skipped. With this change the failure will show up for
the running test.

Update test unmounting to set the detach flag, avoiding races with
btrfs which may see the device as busy when attempting to unmount.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-22 16:29:17 -07:00

34 lines
687 B
Go

package containerd
import (
"context"
"runtime"
"testing"
"github.com/containerd/containerd/snapshot"
"github.com/containerd/containerd/snapshot/testsuite"
)
func newSnapshotter(ctx context.Context, root string) (snapshot.Snapshotter, func() error, error) {
client, err := New(address)
if err != nil {
return nil, nil, err
}
sn := client.SnapshotService(DefaultSnapshotter)
return sn, func() error {
return client.Close()
}, nil
}
func TestSnapshotterClient(t *testing.T) {
if testing.Short() {
t.Skip()
}
if runtime.GOOS == "windows" {
t.Skip("snapshots not yet supported on Windows")
}
testsuite.SnapshotterSuite(t, "SnapshotterClient", newSnapshotter)
}