Skip to content

Commit

Permalink
Fixed e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdzraf committed Aug 1, 2024
1 parent fcf6cf1 commit dc3d3aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/e2e/modify_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,22 @@ var _ = Describe("[ebs-csi-e2e] [single-az] [modify-volume] Modifying a PVC", fu
ebsDriver = driver.InitEbsCSIDriver()
})

parameterWithPrefix := func(prefix string, parameters map[string]string) map[string]string {
result := make(map[string]string)
for key, value := range parameters {
result[prefix+key] = value
}
return result
}

for testName, modifyVolumeTest := range modifyVolumeTests {
modifyVolumeTest := modifyVolumeTest
Context(testName, func() {
It("will modify associated PV and EBS Volume via volume-modifier-for-k8s", func() {
if modifyVolumeTest.ExternalResizerOnly {
Skip("Functionality being tested is not supported for Modification via volume-modifier-for-k8s, skipping test")
}
modifyVolumeTest.CreateVolumeParameters = parameterWithPrefix("ebs.csi.aws.com/", modifyVolumeTest.CreateVolumeParameters)
modifyVolumeTest.Run(cs, ns, ebsDriver, testsuites.VolumeModifierForK8s)
})
It("will modify associated PV and EBS Volume via external-resizer", func() {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/testsuites/e2e_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func ResizeTestPvc(client clientset.Interface, namespace *v1.Namespace, testPvc
// AnnotatePvc annotates supplied k8s pvc object with supplied annotations
func AnnotatePvc(pvc *v1.PersistentVolumeClaim, annotations map[string]string) {
for annotation, value := range annotations {
pvc.Annotations["ebs.csi.aws.com/"+annotation] = value
pvc.Annotations[annotation] = value
}
}

Expand Down

0 comments on commit dc3d3aa

Please sign in to comment.