From 015f2998e59eeaa9088fa0a02184ebf4c04d0b03 Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Thu, 30 Jul 2020 15:54:46 -0700 Subject: [PATCH] Update e2e storage tests for Windows cluster This PR fixes a few things for e2e storage suite to run on Windows cluster. 1. increaes timeout due to longer pod startup time for windows 2. Only set SELinuxOptions or fsGroup if os is not windows 3. Add VolumeSnapshot delete policy for windows3. Add VolumeSnapshot delete policy for windows3. Add VolumeSnapshot delete policy for windows --- test/e2e/framework/pod/create.go | 7 +++++-- test/e2e/storage/testpatterns/testpattern.go | 11 ++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/test/e2e/framework/pod/create.go b/test/e2e/framework/pod/create.go index 9b424de07bd..beb31fdfb4d 100644 --- a/test/e2e/framework/pod/create.go +++ b/test/e2e/framework/pod/create.go @@ -19,6 +19,7 @@ package pod import ( "context" "fmt" + "runtime" "time" v1 "k8s.io/api/core/v1" @@ -179,7 +180,7 @@ func MakeSecPod(podConfig *Config) (*v1.Pod, error) { podConfig.Command = "trap exit TERM; while true; do sleep 1; done" } podName := "pod-" + string(uuid.NewUUID()) - if podConfig.FsGroup == nil { + if podConfig.FsGroup == nil && runtime.GOOS != "windows" { podConfig.FsGroup = func(i int64) *int64 { return &i }(1000) @@ -239,7 +240,9 @@ func MakeSecPod(podConfig *Config) (*v1.Pod, error) { podSpec.Spec.Containers[0].VolumeMounts = volumeMounts podSpec.Spec.Containers[0].VolumeDevices = volumeDevices podSpec.Spec.Volumes = volumes - podSpec.Spec.SecurityContext.SELinuxOptions = podConfig.SeLinuxLabel + if runtime.GOOS != "windows" { + podSpec.Spec.SecurityContext.SELinuxOptions = podConfig.SeLinuxLabel + } SetNodeSelection(&podSpec.Spec, podConfig.NodeSelection) return podSpec, nil diff --git a/test/e2e/storage/testpatterns/testpattern.go b/test/e2e/storage/testpatterns/testpattern.go index ed71723b88c..37d872d8b08 100644 --- a/test/e2e/storage/testpatterns/testpattern.go +++ b/test/e2e/storage/testpatterns/testpattern.go @@ -248,12 +248,13 @@ var ( FsType: "ntfs", FeatureTag: "[sig-windows]", } - // NtfsDynamicPV is TestPattern for "Dynamic PV (xfs)" + // NtfsDynamicPV is TestPattern for "Dynamic PV (ntfs)" NtfsDynamicPV = TestPattern{ - Name: "Dynamic PV (ntfs)", - VolType: DynamicPV, - FsType: "ntfs", - FeatureTag: "[sig-windows]", + Name: "Dynamic PV (ntfs)", + VolType: DynamicPV, + FsType: "ntfs", + FeatureTag: "[sig-windows]", + SnapshotDeletionPolicy: DeleteSnapshot, } // Definitions for Filesystem volume mode