Skip to content

Commit

Permalink
Added e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdzraf committed Jul 9, 2024
1 parent ea09801 commit 6e13ed4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
31 changes: 27 additions & 4 deletions tests/e2e/modify_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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)
})
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/testsuites/e2e_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/testsuites/modify_volume_tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type ModifyVolumeTest struct {
ModifyVolumeAnnotations map[string]string
ShouldResizeVolume bool
ShouldTestInvalidModificationRecovery bool
ExternalResizerOnly bool
}

var (
Expand Down

0 comments on commit 6e13ed4

Please sign in to comment.