Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using size ranges for e2e storage drivers and tests #72275

Closed
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/e2e/framework/volume_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ const (
PodCleanupTimeout = 20 * time.Second
)

// SizeRange encapsulates a size range (along with its units) [min,max] that a storage driver supports.
type SizeRange struct {
Max float64 // Max size specified
Min float64 // Min size specified
Units string // The units in which Min and Max were specified
}

// Configuration of one tests. The test consist of:
// - server pod - runs serverImage, exports ports[]
// - client pod - does not need any special configuration
Expand Down
22 changes: 16 additions & 6 deletions test/e2e/storage/drivers/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ func initHostPathCSIDriver(name string, config testsuites.TestConfig, manifests
Name: name,
FeatureTag: "",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1), // TODO: choose appropriate values
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the values for Min and Max, we can safely choose below defaults:
[Each testsuite]

  • Min: "1Mi" ... Requested minimum requirement from driver side.
  • Max: "10Gi" ... More than or equal to known driver's maximum (5Gi).

[Each Driver]

  • Min: "1Gi" ... Original default size of the tests (Before increasing it to 5Gi)
  • Max: "10Gi" ... The same to testsuites' default maximum.

In addition, we need to add below exception:
[CSI GCE drivers]

  • Min: "5Gi"

https://github.com/kubernetes/kubernetes/blob/master/test/e2e/storage/drivers/csi.go#L173
https://github.com/kubernetes/kubernetes/blob/master/test/e2e/storage/drivers/csi.go#L267

Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
),
Expand Down Expand Up @@ -106,8 +111,8 @@ func (h *hostpathCSIDriver) GetDynamicProvisionStorageClass(fsType string) *stor
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (h *hostpathCSIDriver) GetClaimSize() string {
return "5Gi"
func (h *hostpathCSIDriver) GetClaimSize() framework.SizeRange {
return h.driverInfo.SupportedSizeRange
}

func (h *hostpathCSIDriver) CreateDriver() {
Expand Down Expand Up @@ -175,6 +180,11 @@ func InitGcePDCSIDriver(config testsuites.TestConfig) testsuites.TestDriver {
Name: "pd.csi.storage.gke.io",
FeatureTag: "[Serial]",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1), // TODO: choose appropriate value
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
"ext2",
Expand Down Expand Up @@ -213,8 +223,8 @@ func (g *gcePDCSIDriver) GetDynamicProvisionStorageClass(fsType string) *storage
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (g *gcePDCSIDriver) GetClaimSize() string {
return "5Gi"
func (g *gcePDCSIDriver) GetClaimSize() framework.SizeRange {
return g.driverInfo.SupportedSizeRange
}

func (g *gcePDCSIDriver) CreateDriver() {
Expand Down Expand Up @@ -308,8 +318,8 @@ func (g *gcePDExternalCSIDriver) GetDynamicProvisionStorageClass(fsType string)
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (g *gcePDExternalCSIDriver) GetClaimSize() string {
return "5Gi"
func (g *gcePDExternalCSIDriver) GetClaimSize() framework.SizeRange {
return g.driverInfo.SupportedSizeRange
}

func (g *gcePDExternalCSIDriver) CreateDriver() {
Expand Down
79 changes: 67 additions & 12 deletions test/e2e/storage/drivers/in_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func InitNFSDriver(config testsuites.TestConfig) testsuites.TestDriver {
SupportedFsType: sets.NewString(
"", // Default fsType
),
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedMountOption: sets.NewString("proto=tcp", "relatime"),
RequiredMountOption: sets.NewString("vers=4.1"),
Capabilities: map[testsuites.Capability]bool{
Expand Down Expand Up @@ -141,8 +146,8 @@ func (n *nfsDriver) GetDynamicProvisionStorageClass(fsType string) *storagev1.St
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (n *nfsDriver) GetClaimSize() string {
return "5Gi"
func (n *nfsDriver) GetClaimSize() framework.SizeRange {
return n.driverInfo.SupportedSizeRange
}

func (n *nfsDriver) CreateDriver() {
Expand Down Expand Up @@ -243,6 +248,11 @@ func InitGlusterFSDriver(config testsuites.TestConfig) testsuites.TestDriver {
driverInfo: testsuites.DriverInfo{
Name: "gluster",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
),
Expand Down Expand Up @@ -365,6 +375,11 @@ func InitISCSIDriver(config testsuites.TestConfig) testsuites.TestDriver {
Name: "iscsi",
FeatureTag: "[Feature:Volumes]",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
"ext2",
Expand Down Expand Up @@ -613,6 +628,11 @@ func InitCephFSDriver(config testsuites.TestConfig) testsuites.TestDriver {
Name: "ceph",
FeatureTag: "[Feature:Volumes]",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
),
Expand Down Expand Up @@ -717,6 +737,11 @@ func InitHostPathDriver(config testsuites.TestConfig) testsuites.TestDriver {
driverInfo: testsuites.DriverInfo{
Name: "hostPath",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
),
Expand Down Expand Up @@ -791,6 +816,11 @@ func InitHostPathSymlinkDriver(config testsuites.TestConfig) testsuites.TestDriv
driverInfo: testsuites.DriverInfo{
Name: "hostPathSymlink",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
),
Expand Down Expand Up @@ -1001,6 +1031,11 @@ func InitCinderDriver(config testsuites.TestConfig) testsuites.TestDriver {
driverInfo: testsuites.DriverInfo{
Name: "cinder",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
"ext3",
Expand Down Expand Up @@ -1068,8 +1103,8 @@ func (c *cinderDriver) GetDynamicProvisionStorageClass(fsType string) *storagev1
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (c *cinderDriver) GetClaimSize() string {
return "5Gi"
func (c *cinderDriver) GetClaimSize() framework.SizeRange {
return c.driverInfo.SupportedSizeRange
}

func (c *cinderDriver) CreateDriver() {
Expand Down Expand Up @@ -1170,6 +1205,11 @@ func InitGcePdDriver(config testsuites.TestConfig) testsuites.TestDriver {
"ext4",
"xfs",
),
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedMountOption: sets.NewString("debug", "nouid32"),
Capabilities: map[testsuites.Capability]bool{
testsuites.CapPersistence: true,
Expand Down Expand Up @@ -1236,8 +1276,8 @@ func (g *gcePdDriver) GetDynamicProvisionStorageClass(fsType string) *storagev1.
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (h *gcePdDriver) GetClaimSize() string {
return "5Gi"
func (h *gcePdDriver) GetClaimSize() framework.SizeRange {
return h.driverInfo.SupportedSizeRange
}

func (g *gcePdDriver) CreateDriver() {
Expand Down Expand Up @@ -1290,6 +1330,11 @@ func InitVSphereDriver(config testsuites.TestConfig) testsuites.TestDriver {
driverInfo: testsuites.DriverInfo{
Name: "vSphere",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
"ext4",
Expand Down Expand Up @@ -1364,8 +1409,8 @@ func (v *vSphereDriver) GetDynamicProvisionStorageClass(fsType string) *storagev
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (v *vSphereDriver) GetClaimSize() string {
return "5Gi"
func (v *vSphereDriver) GetClaimSize() framework.SizeRange {
return v.driverInfo.SupportedSizeRange
}

func (v *vSphereDriver) CreateDriver() {
Expand Down Expand Up @@ -1414,6 +1459,11 @@ func InitAzureDriver(config testsuites.TestConfig) testsuites.TestDriver {
driverInfo: testsuites.DriverInfo{
Name: "azure",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
"ext4",
Expand Down Expand Up @@ -1488,8 +1538,8 @@ func (a *azureDriver) GetDynamicProvisionStorageClass(fsType string) *storagev1.
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (a *azureDriver) GetClaimSize() string {
return "5Gi"
func (a *azureDriver) GetClaimSize() framework.SizeRange {
return a.driverInfo.SupportedSizeRange
}

func (a *azureDriver) CreateDriver() {
Expand Down Expand Up @@ -1535,6 +1585,11 @@ func InitAwsDriver(config testsuites.TestConfig) testsuites.TestDriver {
driverInfo: testsuites.DriverInfo{
Name: "aws",
MaxFileSize: testpatterns.FileSizeMedium,
SupportedSizeRange: framework.SizeRange{
Min: float64(1),
Max: float64(3),
Units: "Gi",
},
SupportedFsType: sets.NewString(
"", // Default fsType
"ext3",
Expand Down Expand Up @@ -1601,8 +1656,8 @@ func (a *awsDriver) GetDynamicProvisionStorageClass(fsType string) *storagev1.St
return testsuites.GetStorageClass(provisioner, parameters, nil, ns, suffix)
}

func (a *awsDriver) GetClaimSize() string {
return "5Gi"
func (a *awsDriver) GetClaimSize() framework.SizeRange {
return a.driverInfo.SupportedSizeRange
}

func (a *awsDriver) CreateDriver() {
Expand Down