Skip to content

Commit

Permalink
volume expansion test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rajguptavm committed Sep 13, 2024
1 parent 89cf469 commit e3198c5
Showing 1 changed file with 48 additions and 18 deletions.
66 changes: 48 additions & 18 deletions tests/e2e/vsphere_volume_expansion.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {
defaultDatastore *object.Datastore
isVsanHealthServiceStopped bool
isSPSServiceStopped bool
fsType string
)
ginkgo.BeforeEach(func() {
client = f.ClientSet
Expand Down Expand Up @@ -112,6 +113,12 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {
setResourceQuota(svcClient, svNamespace, rqLimit)
}

if windowsEnv {
fsType = ntfsFSType
} else {
fsType = ext4FSType
}

})

ginkgo.AfterEach(func() {
Expand Down Expand Up @@ -183,7 +190,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {

ginkgo.It("[csi-block-vanilla] [csi-guest] [csi-block-vanilla-parallelized] [csi-vcp-mig] Verify volume expansion "+
"with initial filesystem before expansion", ginkgo.Label(p0, block, vanilla, tkg, core), func() {
invokeTestForVolumeExpansionWithFilesystem(f, client, namespace, ext4FSType, "", storagePolicyName, profileID)
invokeTestForVolumeExpansionWithFilesystem(f, client, namespace, fsType, "", storagePolicyName, profileID)
})

// Test to verify offline volume expansion workflow with xfs filesystem.
Expand Down Expand Up @@ -499,7 +506,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {

ginkgo.By("Create StorageClass with allowVolumeExpansion set to true, Create PVC")
volHandle, pvclaim, pv, storageclass := createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, "", storagePolicyName, namespace, ext4FSType)
ctx, f, client, "", storagePolicyName, namespace, fsType)

defer func() {
if !supervisorCluster {
Expand Down Expand Up @@ -575,7 +582,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {
defer cancel()

volHandle, pvclaim, pv, storageclass := createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, "", storagePolicyName, namespace, ext4FSType)
ctx, f, client, "", storagePolicyName, namespace, fsType)
defer func() {
if !supervisorCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
Expand Down Expand Up @@ -647,7 +654,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {
var expectedErrMsg string

volHandle, pvclaim, pv, storageclass := createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, "", storagePolicyName, namespace, ext4FSType)
ctx, f, client, "", storagePolicyName, namespace, fsType)
defer func() {
if !supervisorCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
Expand Down Expand Up @@ -783,7 +790,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {
// featureEnabled := isFssEnabled(vcAddress, cnsNewSyncFSS)

volHandle, pvclaim, pv, storageclass := createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, "", storagePolicyName, namespace, ext4FSType)
ctx, f, client, "", storagePolicyName, namespace, fsType)
defer func() {
if !supervisorCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
Expand Down Expand Up @@ -1046,7 +1053,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {

ginkgo.By("Create StorageClass on shared VVOL datastore with allowVolumeExpansion set to true, Create PVC")
volHandle, pvclaim, pv, storageclass := createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, sharedVVOLdatastoreURL, storagePolicyName, namespace, ext4FSType)
ctx, f, client, sharedVVOLdatastoreURL, storagePolicyName, namespace, fsType)
defer func() {
if !supervisorCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
Expand Down Expand Up @@ -1136,7 +1143,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {

ginkgo.By("Create StorageClass on shared NFS datastore with allowVolumeExpansion set to true")
volHandle, pvclaim, pv, storageclass := createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, sharedNFSdatastoreURL, storagePolicyName, namespace, ext4FSType)
ctx, f, client, sharedNFSdatastoreURL, storagePolicyName, namespace, fsType)
defer func() {
if !supervisorCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
Expand Down Expand Up @@ -1232,7 +1239,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {

ginkgo.By("Create StorageClass on shared VMFS datastore with allowVolumeExpansion set to true")
volHandle, pvclaim, pv, storageclass := createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, sharedVMFSdatastoreURL, storagePolicyName, namespace, ext4FSType)
ctx, f, client, sharedVMFSdatastoreURL, storagePolicyName, namespace, fsType)
defer func() {
if !supervisorCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
Expand Down Expand Up @@ -1896,7 +1903,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {
ginkgo.By("Create StorageClass with allowVolumeExpansion set to true, Create PVC")
sharedVSANDatastoreURL := GetAndExpectStringEnvVar(envSharedDatastoreURL)
volHandle, pvclaim, pv, storageclass = createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, sharedVSANDatastoreURL, storagePolicyName, namespace, ext4FSType)
ctx, f, client, sharedVSANDatastoreURL, storagePolicyName, namespace, fsType)

defer func() {
if !supervisorCluster {
Expand Down Expand Up @@ -2023,7 +2030,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {
ginkgo.By("Create StorageClass with allowVolumeExpansion set to true, Create PVC")
sharedVSANDatastoreURL := GetAndExpectStringEnvVar(envSharedDatastoreURL)
volHandle, pvclaim, pv, storageclass = createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, sharedVSANDatastoreURL, storagePolicyName, namespace, ext4FSType)
ctx, f, client, sharedVSANDatastoreURL, storagePolicyName, namespace, fsType)

defer func() {
if !supervisorCluster {
Expand Down Expand Up @@ -2448,7 +2455,7 @@ var _ = ginkgo.Describe("Volume Expansion Test", func() {
ginkgo.By("Create StorageClass with allowVolumeExpansion set to true, Create PVC")
sharedVSANDatastoreURL := GetAndExpectStringEnvVar(envSharedDatastoreURL)
volHandle, pvclaim, pv, storageclass = createSCwithVolumeExpansionTrueAndDynamicPVC(
ctx, f, client, sharedVSANDatastoreURL, storagePolicyName, namespace, ext4FSType)
ctx, f, client, sharedVSANDatastoreURL, storagePolicyName, namespace, fsType)

defer func() {
if !supervisorCluster {
Expand Down Expand Up @@ -3001,7 +3008,11 @@ func invokeTestForVolumeExpansion(f *framework.Framework, client clientset.Inter
defer cancel()
ginkgo.By("Invoking Test for Volume Expansion")
scParameters := make(map[string]string)
scParameters[scParamFsType] = ext4FSType
if windowsEnv {
scParameters[scParamFsType] = ntfsFSType
} else {
scParameters[scParamFsType] = ext4FSType
}
// Create Storage class and PVC
ginkgo.By("Creating Storage Class and PVC with allowVolumeExpansion = true")
var storageclass *storagev1.StorageClass
Expand Down Expand Up @@ -3242,7 +3253,11 @@ func invokeTestForVolumeExpansionWithFilesystem(f *framework.Framework, client c
defer cancel()
ginkgo.By("Invoking Test for Volume Expansion 2")
scParameters := make(map[string]string)
scParameters[scParamFsType] = fstype
if windowsEnv {
scParameters[scParamFsType] = ntfsFSType
} else {
scParameters[scParamFsType] = fstype
}
// Create Storage class and PVC
ginkgo.By(fmt.Sprintf("Creating Storage Class with %s filesystem and PVC with allowVolumeExpansion = true",
fstype))
Expand Down Expand Up @@ -3478,8 +3493,11 @@ func invokeTestForInvalidVolumeExpansion(f *framework.Framework, client clientse
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
scParameters := make(map[string]string)
scParameters[scParamFsType] = ext4FSType

if windowsEnv {
scParameters[scParamFsType] = ntfsFSType
} else {
scParameters[scParamFsType] = ext4FSType
}
// Create Storage class and PVC
ginkgo.By("Creating Storage Class and PVC with allowVolumeExpansion = false")
var storageclass *storagev1.StorageClass
Expand Down Expand Up @@ -3551,7 +3569,11 @@ func invokeTestForInvalidVolumeShrink(f *framework.Framework, client clientset.I
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
scParameters := make(map[string]string)
scParameters[scParamFsType] = ext4FSType
if windowsEnv {
scParameters[scParamFsType] = ntfsFSType
} else {
scParameters[scParamFsType] = ext4FSType
}

// Create Storage class and PVC
ginkgo.By("Creating Storage Class and PVC with allowVolumeExpansion = true")
Expand Down Expand Up @@ -3664,7 +3686,11 @@ func invokeTestForInvalidVolumeExpansionStaticProvision(f *framework.Framework,
)

scParameters := make(map[string]string)
scParameters[scParamFsType] = ext4FSType
if windowsEnv {
scParameters[scParamFsType] = ntfsFSType
} else {
scParameters[scParamFsType] = ext4FSType
}

// Set up FCD
if os.Getenv(envPandoraSyncWaitTime) != "" {
Expand Down Expand Up @@ -3779,7 +3805,11 @@ func invokeTestForExpandVolumeMultipleTimes(f *framework.Framework, client clien
defer cancel()
ginkgo.By("Invoking Test to verify Multiple Volume Expansions on the same volume")
scParameters := make(map[string]string)
scParameters[scParamFsType] = ext4FSType
if windowsEnv {
scParameters[scParamFsType] = ntfsFSType
} else {
scParameters[scParamFsType] = ext4FSType
}
// Create Storage class and PVC
ginkgo.By("Creating Storage Class and PVC with allowVolumeExpansion = true")
var storageclass *storagev1.StorageClass
Expand Down

0 comments on commit e3198c5

Please sign in to comment.