From eeb649d31e6963be531c6d849e85496b595acf9c Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Wed, 21 Oct 2020 18:42:15 -0700 Subject: [PATCH] Enable Volume Expansion tests for Windows enable volume expansion test for Windows with ntfs file system Change-Id: I6b8027c5e149588f66b8896a78ec5cd0e47984fe --- test/e2e/storage/testpatterns/testpattern.go | 10 ++++++++++ test/e2e/storage/testsuites/volume_expand.go | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/test/e2e/storage/testpatterns/testpattern.go b/test/e2e/storage/testpatterns/testpattern.go index f6057999e16..cf45318a034 100644 --- a/test/e2e/storage/testpatterns/testpattern.go +++ b/test/e2e/storage/testpatterns/testpattern.go @@ -333,6 +333,16 @@ var ( VolType: DynamicPV, AllowExpansion: true, } + + // NtfsDynamicPVAllowExpansion is TestPattern for "Dynamic PV (default fs)(allowExpansion)" + NtfsDynamicPVAllowExpansion = TestPattern{ + Name: "Dynamic PV (ntfs)(allowExpansion)", + VolType: DynamicPV, + AllowExpansion: true, + FsType: "ntfs", + FeatureTag: "[sig-windows]", + } + // BlockVolModeDynamicPVAllowExpansion is TestPattern for "Dynamic PV (block volmode)(allowExpansion)" BlockVolModeDynamicPVAllowExpansion = TestPattern{ Name: "Dynamic PV (block volmode)(allowExpansion)", diff --git a/test/e2e/storage/testsuites/volume_expand.go b/test/e2e/storage/testsuites/volume_expand.go index 1346feb19bb..6f213dfb2cf 100644 --- a/test/e2e/storage/testsuites/volume_expand.go +++ b/test/e2e/storage/testsuites/volume_expand.go @@ -36,6 +36,7 @@ import ( e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper" e2evolume "k8s.io/kubernetes/test/e2e/framework/volume" "k8s.io/kubernetes/test/e2e/storage/testpatterns" + imageutils "k8s.io/kubernetes/test/utils/image" ) const ( @@ -68,6 +69,8 @@ func InitVolumeExpandTestSuite() TestSuite { testpatterns.BlockVolModeDynamicPV, testpatterns.DefaultFsDynamicPVAllowExpansion, testpatterns.BlockVolModeDynamicPVAllowExpansion, + testpatterns.NtfsDynamicPV, + testpatterns.NtfsDynamicPVAllowExpansion, }, SupportedSizeRange: e2evolume.SizeRange{ Min: "1Gi", @@ -176,6 +179,7 @@ func (v *volumeExpandTestSuite) DefineTests(driver TestDriver, pattern testpatte PVCs: []*v1.PersistentVolumeClaim{l.resource.Pvc}, SeLinuxLabel: e2epv.SELinuxLabel, NodeSelection: l.config.ClientNodeSelection, + ImageID: getTestImage(), } l.pod, err = e2epod.CreateSecPodWithNodeSelection(f.ClientSet, &podConfig, framework.PodStartTimeout) defer func() { @@ -219,6 +223,7 @@ func (v *volumeExpandTestSuite) DefineTests(driver TestDriver, pattern testpatte PVCs: []*v1.PersistentVolumeClaim{l.resource.Pvc}, SeLinuxLabel: e2epv.SELinuxLabel, NodeSelection: l.config.ClientNodeSelection, + ImageID: getTestImage(), } l.pod2, err = e2epod.CreateSecPodWithNodeSelection(f.ClientSet, &podConfig, resizedPodStartupTimeout) defer func() { @@ -246,6 +251,7 @@ func (v *volumeExpandTestSuite) DefineTests(driver TestDriver, pattern testpatte PVCs: []*v1.PersistentVolumeClaim{l.resource.Pvc}, SeLinuxLabel: e2epv.SELinuxLabel, NodeSelection: l.config.ClientNodeSelection, + ImageID: getTestImage(), } l.pod, err = e2epod.CreateSecPodWithNodeSelection(f.ClientSet, &podConfig, framework.PodStartTimeout) defer func() { @@ -420,3 +426,12 @@ func WaitForFSResize(pvc *v1.PersistentVolumeClaim, c clientset.Interface) (*v1. } return updatedPVC, nil } + +// TODO: after issue https://github.com/kubernetes/kubernetes/issues/81245 is resolved +// this utility can be moved to e2epod +func getTestImage() int { + if framework.NodeOSDistroIs("windows") { + return imageutils.Agnhost + } + return imageutils.BusyBox +}