Skip to content

Enable Kubernetes e2e tests for volume cloning #875

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/k8s-integration/config/test-config-template.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ StorageClass:
SnapshotClass:
FromFile: {{ .SnapshotClassFile }}
{{end}}
{{if .Timeouts}}
Timeouts:
{{ range $key, $value := .Timeouts }}{{ $key }}: {{ $value }}
{{ end }}
{{end}}
DriverInfo:
Name: csi-gcepd-{{.StorageClass}}
SupportedFsType:
Expand Down
10 changes: 10 additions & 0 deletions test/k8s-integration/driver-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ type driverConfig struct {
SupportedFsType []string
MinimumVolumeSize string
NumAllowedTopologies int
Timeouts map[string]string
}

const (
testConfigDir = "test/k8s-integration/config"
configTemplateFile = "test-config-template.in"
configFile = "test-config.yaml"
// configurable timeouts for the k8s e2e testsuites
dataSourceProvisionTimeout = "480s"

// These are keys for the configurable timeout map.
dataSourceProvisionTimeoutKey = "DataSourceProvision"
)

// generateDriverConfigFile loads a testdriver config template and creates a file
Expand Down Expand Up @@ -123,6 +129,9 @@ func generateDriverConfigFile(testParams *testParameters, storageClassFile strin
minimumVolumeSize = "200Gi"
numAllowedTopologies = 2
}
timeouts := map[string]string{
dataSourceProvisionTimeoutKey: dataSourceProvisionTimeout,
}
params := driverConfig{
StorageClassFile: filepath.Join(testParams.pkgDir, testConfigDir, storageClassFile),
StorageClass: storageClassFile[:strings.LastIndex(storageClassFile, ".")],
Expand All @@ -131,6 +140,7 @@ func generateDriverConfigFile(testParams *testParameters, storageClassFile strin
Capabilities: caps,
MinimumVolumeSize: minimumVolumeSize,
NumAllowedTopologies: numAllowedTopologies,
Timeouts: timeouts,
}

// Write config file
Expand Down
7 changes: 1 addition & 6 deletions test/k8s-integration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,7 @@ func generateGCETestSkip(testParams *testParameters) string {
if testParams.platform == "windows" {
skipString = skipString + "|\\[LinuxOnly\\]"
}
// Volume cloning has timeouts due to GCE disk cloning rate limits, and operation serialization
// race conditions where the cloning begins while the source disk is still being created.
skipString = skipString + "|provisioning\\sshould\\sprovision\\sstorage\\swith\\spvc\\sdata\\ssource[^|]*"

return skipString
}

Expand Down Expand Up @@ -588,9 +586,6 @@ func generateGKETestSkip(testParams *testParameters) string {
(!testParams.useGKEManagedDriver && (*curVer).lessThan(mustParseVersion("1.17.0"))) {
skipString = skipString + "|VolumeSnapshotDataSource"
}
// Volume cloning has timeouts due to GCE disk cloning rate limits, and operation serialization
// race conditions where the cloning begins while the source disk is still being created.
skipString = skipString + "|provisioning\\sshould\\sprovision\\sstorage\\swith\\spvc\\sdata\\ssource[^|]*"
return skipString
}

Expand Down