From 6e13ed4a53ad501dfb2eb1f133184d83065fa83a Mon Sep 17 00:00:00 2001 From: Rafael Mendez Date: Tue, 9 Jul 2024 17:12:57 +0000 Subject: [PATCH] Added e2e tests --- tests/e2e/modify_volume.go | 31 +++++++++++++++++--- tests/e2e/testsuites/e2e_utils.go | 4 +-- tests/e2e/testsuites/modify_volume_tester.go | 1 + 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/tests/e2e/modify_volume.go b/tests/e2e/modify_volume.go index 62c92002a3..36ec7de9f2 100644 --- a/tests/e2e/modify_volume.go +++ b/tests/e2e/modify_volume.go @@ -60,15 +60,36 @@ var ( ShouldResizeVolume: false, ShouldTestInvalidModificationRecovery: false, }, - "with new throughput and iops annotations": { + "with a new tag annotation": { + CreateVolumeParameters: defaultModifyVolumeTestGp3CreateVolumeParameters, + ModifyVolumeAnnotations: map[string]string{ + testsuites.AnnotationsTagSpec: "key1=test1", + }, + ShouldResizeVolume: false, + ShouldTestInvalidModificationRecovery: false, + ExternalResizerOnly: true, + }, + "with new throughput, and iops annotations": { CreateVolumeParameters: defaultModifyVolumeTestGp3CreateVolumeParameters, ModifyVolumeAnnotations: map[string]string{ testsuites.AnnotationIops: "4000", testsuites.AnnotationThroughput: "150", + testsuites.AnnotationsTagSpec: "key2=test2", }, ShouldResizeVolume: false, ShouldTestInvalidModificationRecovery: false, }, + "with new throughput, iops, and tag annotations": { + CreateVolumeParameters: defaultModifyVolumeTestGp3CreateVolumeParameters, + ModifyVolumeAnnotations: map[string]string{ + testsuites.AnnotationIops: "4000", + testsuites.AnnotationThroughput: "150", + testsuites.AnnotationsTagSpec: "key2=test2", + }, + ShouldResizeVolume: false, + ShouldTestInvalidModificationRecovery: false, + ExternalResizerOnly: true, + }, "with a larger size and new throughput and iops annotations": { CreateVolumeParameters: defaultModifyVolumeTestGp3CreateVolumeParameters, ModifyVolumeAnnotations: map[string]string{ @@ -123,9 +144,11 @@ var _ = Describe("[ebs-csi-e2e] [single-az] [modify-volume] Modifying a PVC", fu for testName, modifyVolumeTest := range modifyVolumeTests { modifyVolumeTest := modifyVolumeTest Context(testName, func() { - It("will modify associated PV and EBS Volume via volume-modifier-for-k8s", func() { - modifyVolumeTest.Run(cs, ns, ebsDriver, testsuites.VolumeModifierForK8s) - }) + if !modifyVolumeTest.ExternalResizerOnly { + It("will modify associated PV and EBS Volume via volume-modifier-for-k8s", func() { + modifyVolumeTest.Run(cs, ns, ebsDriver, testsuites.VolumeModifierForK8s) + }) + } It("will modify associated PV and EBS Volume via external-resizer", func() { modifyVolumeTest.Run(cs, ns, ebsDriver, testsuites.ExternalResizer) }) diff --git a/tests/e2e/testsuites/e2e_utils.go b/tests/e2e/testsuites/e2e_utils.go index 4f5e20db16..e69d7d4b1d 100644 --- a/tests/e2e/testsuites/e2e_utils.go +++ b/tests/e2e/testsuites/e2e_utils.go @@ -42,8 +42,8 @@ const ( AnnotationIops = "ebs.csi.aws.com/iops" AnnotationThroughput = "ebs.csi.aws.com/throughput" AnnotationVolumeType = "ebs.csi.aws.com/volumeType" - // AnnotationsTagSpec = "ebs.csi.aws.com/tagSpecification" - // AnnotationTagDel = "ebs.csi.aws.com/tagDeletion" + AnnotationsTagSpec = "ebs.csi.aws.com/tagSpecification" + AnnotationTagDel = "ebs.csi.aws.com/tagDeletion" ) var DefaultGeneratedVolumeMount = VolumeMountDetails{ diff --git a/tests/e2e/testsuites/modify_volume_tester.go b/tests/e2e/testsuites/modify_volume_tester.go index daf9b46ff4..d8d4015a5f 100644 --- a/tests/e2e/testsuites/modify_volume_tester.go +++ b/tests/e2e/testsuites/modify_volume_tester.go @@ -34,6 +34,7 @@ type ModifyVolumeTest struct { ModifyVolumeAnnotations map[string]string ShouldResizeVolume bool ShouldTestInvalidModificationRecovery bool + ExternalResizerOnly bool } var (