integration: Enable some tests for Windows (part 2)
Some of the tests that are currently running only on Linux can be made to run on Windows with a few changes. Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
This commit is contained in:
@@ -28,10 +28,6 @@ import (
|
||||
)
|
||||
|
||||
func TestLeaseResources(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
ctx, cancel := testContext(t)
|
||||
defer cancel()
|
||||
|
||||
@@ -41,11 +37,15 @@ func TestLeaseResources(t *testing.T) {
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
snapshotterName := "native"
|
||||
if runtime.GOOS == "windows" {
|
||||
snapshotterName = "windows"
|
||||
}
|
||||
var (
|
||||
ls = client.LeasesService()
|
||||
cs = client.ContentStore()
|
||||
imgSrv = client.ImageService()
|
||||
sn = client.SnapshotService("native")
|
||||
sn = client.SnapshotService(snapshotterName)
|
||||
)
|
||||
|
||||
l, err := ls.Create(ctx, leases.WithRandomID())
|
||||
@@ -57,7 +57,7 @@ func TestLeaseResources(t *testing.T) {
|
||||
// step 1: download image
|
||||
imageName := "k8s.gcr.io/pause:3.6"
|
||||
|
||||
image, err := client.Pull(ctx, imageName, WithPullUnpack, WithPullSnapshotter("native"))
|
||||
image, err := client.Pull(ctx, imageName, WithPullUnpack, WithPullSnapshotter(snapshotterName))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -86,7 +86,7 @@ func TestLeaseResources(t *testing.T) {
|
||||
// step 2: reference snapshotter with lease
|
||||
r := leases.Resource{
|
||||
ID: chainID.String(),
|
||||
Type: "snapshots/native",
|
||||
Type: "snapshots/" + snapshotterName,
|
||||
}
|
||||
|
||||
if err := ls.AddResource(ctx, l, r); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user