@@ -22,6 +22,7 @@ import (
2222 "fmt"
2323 "os"
2424 "reflect"
25+ "runtime"
2526 "syscall"
2627 "testing"
2728
@@ -37,7 +38,16 @@ const (
3738 targetTest = "./target_test"
3839)
3940
41+ // skip test if running on windows
42+ func skipTestIfWindows (t * testing.T ) {
43+ if runtime .GOOS == "windows" {
44+ t .Skip ("Skipping test on Windows" )
45+ }
46+ }
47+
4048func TestNodeStageVolume (t * testing.T ) {
49+ skipTestIfWindows (t )
50+
4151 stdVolCap := csi.VolumeCapability {
4252 AccessType : & csi.VolumeCapability_Mount {
4353 Mount : & csi.VolumeCapability_MountVolume {},
@@ -180,6 +190,7 @@ func TestNodeExpandVolume(t *testing.T) {
180190}
181191
182192func TestNodePublishVolume (t * testing.T ) {
193+ skipTestIfWindows (t )
183194 volumeCap := csi.VolumeCapability_AccessMode {Mode : csi .VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER }
184195 errorMountSource := "./error_mount_source"
185196 alreadyMountedTarget := "./false_is_likely_exist_target"
@@ -283,6 +294,7 @@ func TestNodePublishVolume(t *testing.T) {
283294}
284295
285296func TestNodeUnpublishVolume (t * testing.T ) {
297+ skipTestIfWindows (t )
286298 errorTarget := "./error_is_likely_target"
287299 targetFile := "./abc.go"
288300
@@ -334,6 +346,7 @@ func TestNodeUnpublishVolume(t *testing.T) {
334346}
335347
336348func TestNodeUnstageVolume (t * testing.T ) {
349+ skipTestIfWindows (t )
337350 errorTarget := "./error_is_likely_target"
338351 targetFile := "./abc.go"
339352
0 commit comments