Skip to content

Commit c4ccb62

Browse files
authored
Merge pull request kubernetes#80247 from jsafrane/e2e-volume-limits
Add e2e test for CSI volume limits
2 parents 41049fd + 90d0991 commit c4ccb62

File tree

8 files changed

+371
-4
lines changed

8 files changed

+371
-4
lines changed

test/e2e/storage/csi_volumes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var csiTestSuites = []func() testsuites.TestSuite{
5252
testsuites.InitMultiVolumeTestSuite,
5353
testsuites.InitDisruptiveTestSuite,
5454
testsuites.InitVolumeExpandTestSuite,
55+
testsuites.InitVolumeLimitsTestSuite,
5556
}
5657

5758
// This executes testSuites for csi volumes.

test/e2e/storage/drivers/csi.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@ func InitMockCSIDriver(driverOpts CSIMockDriverOpts) testsuites.TestDriver {
252252
"", // Default fsType
253253
),
254254
Capabilities: map[testsuites.Capability]bool{
255-
testsuites.CapPersistence: false,
256-
testsuites.CapFsGroup: false,
257-
testsuites.CapExec: false,
255+
testsuites.CapPersistence: false,
256+
testsuites.CapFsGroup: false,
257+
testsuites.CapExec: false,
258+
testsuites.CapVolumeLimits: true,
258259
},
259260
},
260261
manifests: driverManifests,
@@ -387,6 +388,9 @@ func InitGcePDCSIDriver() testsuites.TestDriver {
387388
testsuites.CapFsGroup: true,
388389
testsuites.CapExec: true,
389390
testsuites.CapMultiPODs: true,
391+
// GCE supports volume limits, but the test creates large
392+
// number of volumes and times out test suites.
393+
testsuites.CapVolumeLimits: false,
390394
},
391395
RequiredAccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce},
392396
},

test/e2e/storage/drivers/in_tree.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,9 @@ func InitCinderDriver() testsuites.TestDriver {
988988
testsuites.CapPersistence: true,
989989
testsuites.CapFsGroup: true,
990990
testsuites.CapExec: true,
991+
// Cinder supports volume limits, but the test creates large
992+
// number of volumes and times out test suites.
993+
testsuites.CapVolumeLimits: false,
991994
},
992995
},
993996
}
@@ -1159,6 +1162,9 @@ func InitGcePdDriver() testsuites.TestDriver {
11591162
testsuites.CapMultiPODs: true,
11601163
testsuites.CapControllerExpansion: true,
11611164
testsuites.CapNodeExpansion: true,
1165+
// GCE supports volume limits, but the test creates large
1166+
// number of volumes and times out test suites.
1167+
testsuites.CapVolumeLimits: false,
11621168
},
11631169
},
11641170
}
@@ -1413,6 +1419,9 @@ func InitAzureDriver() testsuites.TestDriver {
14131419
testsuites.CapBlock: true,
14141420
testsuites.CapExec: true,
14151421
testsuites.CapMultiPODs: true,
1422+
// Azure supports volume limits, but the test creates large
1423+
// number of volumes and times out test suites.
1424+
testsuites.CapVolumeLimits: false,
14161425
},
14171426
},
14181427
}
@@ -1537,6 +1546,9 @@ func InitAwsDriver() testsuites.TestDriver {
15371546
testsuites.CapMultiPODs: true,
15381547
testsuites.CapControllerExpansion: true,
15391548
testsuites.CapNodeExpansion: true,
1549+
// AWS supports volume limits, but the test creates large
1550+
// number of volumes and times out test suites.
1551+
testsuites.CapVolumeLimits: false,
15401552
},
15411553
},
15421554
}

test/e2e/storage/external/external.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ var csiTestSuites = []func() testsuites.TestSuite{
5050
testsuites.InitVolumesTestSuite,
5151
testsuites.InitVolumeExpandTestSuite,
5252
testsuites.InitDisruptiveTestSuite,
53+
testsuites.InitVolumeLimitsTestSuite,
5354
}
5455

5556
func init() {

test/e2e/storage/in_tree_volumes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ var testSuites = []func() testsuites.TestSuite{
5858
testsuites.InitMultiVolumeTestSuite,
5959
testsuites.InitVolumeExpandTestSuite,
6060
testsuites.InitDisruptiveTestSuite,
61+
testsuites.InitVolumeLimitsTestSuite,
6162
}
6263

6364
// This executes testSuites for in-tree volumes.

test/e2e/storage/testsuites/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ go_library(
1414
"testdriver.go",
1515
"volume_expand.go",
1616
"volume_io.go",
17+
"volumelimits.go",
1718
"volumemode.go",
1819
"volumes.go",
1920
],
@@ -22,8 +23,10 @@ go_library(
2223
deps = [
2324
"//pkg/controller/volume/events:go_default_library",
2425
"//pkg/kubelet/events:go_default_library",
26+
"//pkg/volume/util:go_default_library",
2527
"//staging/src/k8s.io/api/core/v1:go_default_library",
2628
"//staging/src/k8s.io/api/storage/v1:go_default_library",
29+
"//staging/src/k8s.io/api/storage/v1beta1:go_default_library",
2730
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
2831
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
2932
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
@@ -39,6 +42,7 @@ go_library(
3942
"//staging/src/k8s.io/client-go/dynamic:go_default_library",
4043
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
4144
"//staging/src/k8s.io/csi-translation-lib:go_default_library",
45+
"//staging/src/k8s.io/csi-translation-lib/plugins:go_default_library",
4246
"//test/e2e/common:go_default_library",
4347
"//test/e2e/framework:go_default_library",
4448
"//test/e2e/framework/log:go_default_library",

test/e2e/storage/testsuites/testdriver.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package testsuites
1818

1919
import (
20-
"k8s.io/api/core/v1"
20+
v1 "k8s.io/api/core/v1"
2121
storagev1 "k8s.io/api/storage/v1"
2222
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2323
"k8s.io/apimachinery/pkg/util/sets"
@@ -155,6 +155,7 @@ const (
155155
CapRWX Capability = "RWX" // support ReadWriteMany access modes
156156
CapControllerExpansion Capability = "controllerExpansion" // support volume expansion for controller
157157
CapNodeExpansion Capability = "nodeExpansion" // support volume expansion for node
158+
CapVolumeLimits = "volumeLimits" // support volume limits (can be *very* slow)
158159
)
159160

160161
// DriverInfo represents static information about a TestDriver.

0 commit comments

Comments
 (0)