Skip to content

Commit

Permalink
Refactor E2E: Remove hidden performance parameter setting
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSirenko committed Nov 24, 2023
1 parent 97688f8 commit 70db58b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 51 deletions.
51 changes: 0 additions & 51 deletions tests/e2e/driver/ebs_csi_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ func GetParameters(volumeType string, fsType string, encrypted bool, additionalP
"type": volumeType,
"csi.storage.k8s.io/fstype": fsType,
}
if iopsPerGB := IOPSPerGBForVolumeType(volumeType); iopsPerGB != "" {
parameters[ebscsidriver.IopsPerGBKey] = iopsPerGB
}
if iops := IOPSForVolumeType(volumeType); iops != "" {
parameters[ebscsidriver.IopsKey] = iops
}
if throughput := ThroughputForVolumeType(volumeType); throughput != "" {
parameters[ebscsidriver.ThroughputKey] = throughput
}
if encrypted {
parameters[ebscsidriver.EncryptedKey] = True
}
Expand All @@ -148,45 +139,3 @@ func MinimumSizeForVolumeType(volumeType string) string {
return "1Gi"
}
}

// IOPSPerGBForVolumeType returns the maximum iops per GB for each volumeType
// Otherwise returns an empty string
func IOPSPerGBForVolumeType(volumeType string) string {
switch volumeType {
case "io1":
// Maximum IOPS/GB for io1 is 50
return "50"
case "io2":
// Maximum IOPS/GB for io2 is 500
return "500"
default:
return ""
}
}

// IOPSForVolumeType returns the maximum iops for each volumeType
// Otherwise returns an empty string
func IOPSForVolumeType(volumeType string) string {
switch volumeType {
case "gp3":
// Maximum IOPS for gp3 is 16000. However, maximum IOPS/GB for gp3 is 500.
// Since the tests will run using minimum volume capacity (1GB), set to 3000
// because minimum IOPS for gp3 is 3000.
return "3000"
default:
return ""
}
}

// ThroughputPerVolumeType returns the maximum throughput for each volumeType
// Otherwise returns an empty string
func ThroughputForVolumeType(volumeType string) string {
switch volumeType {
case "gp3":
// Maximum throughput for gp3 is 1000. However, maximum throughput/iops for gp3 is 0.25
// Since the default iops is 3000, set to 750.
return "750"
default:
return ""
}
}
24 changes: 24 additions & 0 deletions tests/e2e/dynamic_provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
{
Volumes: []testsuites.VolumeDetails{
{
AdditionalParameters: map[string]string{
ebscsidriver.IopsKey: testsuites.DefaultE2EIopsIoVolumes,
},
VolumeType: awscloud.VolumeTypeIO2,
ClaimSize: driver.MinimumSizeForVolumeType(awscloud.VolumeTypeIO2),
VolumeMode: testsuites.Block,
Expand All @@ -259,6 +262,9 @@ var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
{
Volumes: []testsuites.VolumeDetails{
{
AdditionalParameters: map[string]string{
ebscsidriver.IopsKey: testsuites.DefaultE2EIopsIoVolumes,
},
VolumeType: awscloud.VolumeTypeIO2,
ClaimSize: driver.MinimumSizeForVolumeType(awscloud.VolumeTypeIO2),
VolumeMode: testsuites.Block,
Expand Down Expand Up @@ -289,6 +295,9 @@ var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
{
Volumes: []testsuites.VolumeDetails{
{
AdditionalParameters: map[string]string{
ebscsidriver.IopsKey: testsuites.DefaultE2EIopsIoVolumes,
},
VolumeType: awscloud.VolumeTypeIO2,
ClaimSize: driver.MinimumSizeForVolumeType(awscloud.VolumeTypeIO2),
VolumeMode: testsuites.Block,
Expand All @@ -304,6 +313,9 @@ var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
{
Volumes: []testsuites.VolumeDetails{
{
AdditionalParameters: map[string]string{
ebscsidriver.IopsKey: testsuites.DefaultE2EIopsIoVolumes,
},
VolumeType: awscloud.VolumeTypeIO2,
ClaimSize: driver.MinimumSizeForVolumeType(awscloud.VolumeTypeIO2),
VolumeMode: testsuites.Block,
Expand Down Expand Up @@ -333,6 +345,9 @@ var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
{
Volumes: []testsuites.VolumeDetails{
{
AdditionalParameters: map[string]string{
ebscsidriver.IopsKey: testsuites.DefaultE2EIopsIoVolumes,
},
VolumeType: awscloud.VolumeTypeIO2,
FSType: ebscsidriver.FSTypeExt4,
VolumeMode: testsuites.FileSystem,
Expand All @@ -349,6 +364,9 @@ var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
{
Volumes: []testsuites.VolumeDetails{
{
AdditionalParameters: map[string]string{
ebscsidriver.IopsKey: testsuites.DefaultE2EIopsIoVolumes,
},
VolumeType: awscloud.VolumeTypeIO2,
FSType: ebscsidriver.FSTypeExt4,
VolumeMode: testsuites.FileSystem,
Expand Down Expand Up @@ -426,6 +444,9 @@ var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
Cmd: "dd if=/dev/zero of=/dev/xvda bs=1024k count=100 && echo 'hello world' > /mnt/test-1/data && grep 'hello world' /mnt/test-1/data",
Volumes: []testsuites.VolumeDetails{
{
AdditionalParameters: map[string]string{
ebscsidriver.IopsKey: testsuites.DefaultE2EIopsIoVolumes,
},
VolumeType: awscloud.VolumeTypeIO1,
FSType: ebscsidriver.FSTypeExt4,
ClaimSize: driver.MinimumSizeForVolumeType(awscloud.VolumeTypeIO1),
Expand Down Expand Up @@ -477,6 +498,9 @@ var _ = Describe("[ebs-csi-e2e] [single-az] Dynamic Provisioning", func() {
Cmd: "while true; do echo $(date -u) >> /mnt/test-1/data; sleep 1; done",
Volumes: []testsuites.VolumeDetails{
{
AdditionalParameters: map[string]string{
ebscsidriver.IopsKey: testsuites.DefaultE2EIopsIoVolumes,
},
VolumeType: awscloud.VolumeTypeIO1,
FSType: ebscsidriver.FSTypeExt4,
ClaimSize: driver.MinimumSizeForVolumeType(awscloud.VolumeTypeIO1),
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/testsuites/e2e_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import "fmt"
const (
DefaultVolumeName = "test-volume-1"
DefaultMountPath = "/mnt/default-mount"

DefaultE2EIopsIoVolumes = "100"
)

func PodCmdWriteToVolume(volumeMountPath string) string {
Expand Down

0 comments on commit 70db58b

Please sign in to comment.