Skip to content

Commit 65e85a5

Browse files
authored
Merge pull request #875 from amacaskill/enable-cloning-tests
Enable Kubernetes e2e tests for volume cloning
2 parents bb31c9b + 0875701 commit 65e85a5

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

test/k8s-integration/config/test-config-template.in

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ StorageClass:
44
SnapshotClass:
55
FromFile: {{ .SnapshotClassFile }}
66
{{end}}
7+
{{if .Timeouts}}
8+
Timeouts:
9+
{{ range $key, $value := .Timeouts }}{{ $key }}: {{ $value }}
10+
{{ end }}
11+
{{end}}
712
DriverInfo:
813
Name: csi-gcepd-{{.StorageClass}}
914
SupportedFsType:

test/k8s-integration/driver-config.go

+10
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ type driverConfig struct {
1717
SupportedFsType []string
1818
MinimumVolumeSize string
1919
NumAllowedTopologies int
20+
Timeouts map[string]string
2021
}
2122

2223
const (
2324
testConfigDir = "test/k8s-integration/config"
2425
configTemplateFile = "test-config-template.in"
2526
configFile = "test-config.yaml"
27+
// configurable timeouts for the k8s e2e testsuites
28+
dataSourceProvisionTimeout = "480s"
29+
30+
// These are keys for the configurable timeout map.
31+
dataSourceProvisionTimeoutKey = "DataSourceProvision"
2632
)
2733

2834
// generateDriverConfigFile loads a testdriver config template and creates a file
@@ -123,6 +129,9 @@ func generateDriverConfigFile(testParams *testParameters, storageClassFile strin
123129
minimumVolumeSize = "200Gi"
124130
numAllowedTopologies = 2
125131
}
132+
timeouts := map[string]string{
133+
dataSourceProvisionTimeoutKey: dataSourceProvisionTimeout,
134+
}
126135
params := driverConfig{
127136
StorageClassFile: filepath.Join(testParams.pkgDir, testConfigDir, storageClassFile),
128137
StorageClass: storageClassFile[:strings.LastIndex(storageClassFile, ".")],
@@ -131,6 +140,7 @@ func generateDriverConfigFile(testParams *testParameters, storageClassFile strin
131140
Capabilities: caps,
132141
MinimumVolumeSize: minimumVolumeSize,
133142
NumAllowedTopologies: numAllowedTopologies,
143+
Timeouts: timeouts,
134144
}
135145

136146
// Write config file

test/k8s-integration/main.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,7 @@ func generateGCETestSkip(testParams *testParameters) string {
543543
if testParams.platform == "windows" {
544544
skipString = skipString + "|\\[LinuxOnly\\]"
545545
}
546-
// Volume cloning has timeouts due to GCE disk cloning rate limits, and operation serialization
547-
// race conditions where the cloning begins while the source disk is still being created.
548-
skipString = skipString + "|provisioning\\sshould\\sprovision\\sstorage\\swith\\spvc\\sdata\\ssource[^|]*"
546+
549547
return skipString
550548
}
551549

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

0 commit comments

Comments
 (0)