Skip to content

Commit 3a3da69

Browse files
TBBlegabriel-samfira
authored andcommitted
Run Windows snapshotter through the test suite
Signed-off-by: Paul "TBBle" Hampson <[email protected]>
1 parent e7b6232 commit 3a3da69

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

snapshots/windows/windows_test.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//go:build windows
2+
// +build windows
3+
4+
/*
5+
Copyright The containerd Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
*/
19+
20+
package windows
21+
22+
import (
23+
"context"
24+
"testing"
25+
26+
"github.com/containerd/containerd/pkg/testutil"
27+
"github.com/containerd/containerd/snapshots"
28+
"github.com/containerd/containerd/snapshots/testsuite"
29+
)
30+
31+
func newSnapshotter(ctx context.Context, root string) (snapshots.Snapshotter, func() error, error) {
32+
snapshotter, err := NewSnapshotter(root)
33+
if err != nil {
34+
return nil, nil, err
35+
}
36+
37+
return snapshotter, func() error { return snapshotter.Close() }, nil
38+
}
39+
40+
func TestWindows(t *testing.T) {
41+
testutil.RequiresRoot(t)
42+
testsuite.SnapshotterSuite(t, "Windows", newSnapshotter)
43+
}

0 commit comments

Comments
 (0)