containerd/snapshot_test.go
Akihiro Suda 4feb6f228a snapshot: add Close()
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-11-14 02:00:33 +00:00

35 lines
728 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 {
// no need to close remote snapshotter
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)
}