Enable Volume Expansion tests for Windows

enable volume expansion test for Windows with ntfs file system

Change-Id: I6b8027c5e149588f66b8896a78ec5cd0e47984fe
This commit is contained in:
Jing Xu 2020-10-21 18:42:15 -07:00
parent 78828078ca
commit eeb649d31e
2 changed files with 25 additions and 0 deletions

View File

@ -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)",

View File

@ -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
}