@@ -191,15 +191,13 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
191
191
controllerExpansionSupported bool
192
192
)
193
193
194
- createVolume := func (volumeName string ) * csi.CreateVolumeResponse {
194
+ createVolumeWithCapability := func (volumeName string , cap * csi. VolumeCapability ) * csi.CreateVolumeResponse {
195
195
By ("creating a single node writer volume for expansion" )
196
196
return r .MustCreateVolume (
197
197
context .Background (),
198
198
& csi.CreateVolumeRequest {
199
- Name : volumeName ,
200
- VolumeCapabilities : []* csi.VolumeCapability {
201
- TestVolumeCapabilityWithAccessType (sc , csi .VolumeCapability_AccessMode_SINGLE_NODE_WRITER ),
202
- },
199
+ Name : volumeName ,
200
+ VolumeCapabilities : []* csi.VolumeCapability {cap },
203
201
CapacityRange : & csi.CapacityRange {
204
202
RequiredBytes : TestVolumeSize (sc ),
205
203
},
@@ -208,8 +206,11 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
208
206
},
209
207
)
210
208
}
209
+ createVolume := func (volumeName string ) * csi.CreateVolumeResponse {
210
+ return createVolumeWithCapability (volumeName , TestVolumeCapabilityWithAccessType (sc , csi .VolumeCapability_AccessMode_SINGLE_NODE_WRITER ))
211
+ }
211
212
212
- controllerPublishVolume := func (volumeName string , vol * csi.CreateVolumeResponse , nid * csi.NodeGetInfoResponse ) * csi.ControllerPublishVolumeResponse {
213
+ controllerPublishVolumeWithCapability := func (volumeName string , vol * csi.CreateVolumeResponse , nid * csi.NodeGetInfoResponse , cap * csi. VolumeCapability ) * csi.ControllerPublishVolumeResponse {
213
214
var conpubvol * csi.ControllerPublishVolumeResponse
214
215
if controllerPublishSupported {
215
216
By ("controller publishing volume" )
@@ -219,7 +220,7 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
219
220
& csi.ControllerPublishVolumeRequest {
220
221
VolumeId : vol .GetVolume ().GetVolumeId (),
221
222
NodeId : nid .GetNodeId (),
222
- VolumeCapability : TestVolumeCapabilityWithAccessType ( sc , csi . VolumeCapability_AccessMode_SINGLE_NODE_WRITER ) ,
223
+ VolumeCapability : cap ,
223
224
VolumeContext : vol .GetVolume ().GetVolumeContext (),
224
225
Readonly : false ,
225
226
Secrets : sc .Secrets .ControllerPublishVolumeSecret ,
@@ -228,14 +229,17 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
228
229
}
229
230
return conpubvol
230
231
}
232
+ controllerPublishVolume := func (volumeName string , vol * csi.CreateVolumeResponse , nid * csi.NodeGetInfoResponse ) * csi.ControllerPublishVolumeResponse {
233
+ return controllerPublishVolumeWithCapability (volumeName , vol , nid , TestVolumeCapabilityWithAccessType (sc , csi .VolumeCapability_AccessMode_SINGLE_NODE_WRITER ))
234
+ }
231
235
232
- nodeStageVolume := func (volumeName string , vol * csi.CreateVolumeResponse , conpubvol * csi.ControllerPublishVolumeResponse ) * csi.NodeStageVolumeResponse {
236
+ nodeStageVolumeWithCapability := func (volumeName string , vol * csi.CreateVolumeResponse , conpubvol * csi.ControllerPublishVolumeResponse , cap * csi. VolumeCapability ) * csi.NodeStageVolumeResponse {
233
237
// NodeStageVolume
234
238
if nodeStageSupported {
235
239
By ("node staging volume" )
236
240
nodeStageRequest := & csi.NodeStageVolumeRequest {
237
241
VolumeId : vol .GetVolume ().GetVolumeId (),
238
- VolumeCapability : TestVolumeCapabilityWithAccessType ( sc , csi . VolumeCapability_AccessMode_SINGLE_NODE_WRITER ) ,
242
+ VolumeCapability : cap ,
239
243
StagingTargetPath : sc .StagingPath ,
240
244
VolumeContext : vol .GetVolume ().GetVolumeContext (),
241
245
Secrets : sc .Secrets .NodeStageVolumeSecret ,
@@ -253,8 +257,11 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
253
257
}
254
258
return nil
255
259
}
260
+ nodeStageVolume := func (volumeName string , vol * csi.CreateVolumeResponse , conpubvol * csi.ControllerPublishVolumeResponse ) * csi.NodeStageVolumeResponse {
261
+ return nodeStageVolumeWithCapability (volumeName , vol , conpubvol , TestVolumeCapabilityWithAccessType (sc , csi .VolumeCapability_AccessMode_SINGLE_NODE_WRITER ))
262
+ }
256
263
257
- nodePublishVolume := func (volumeName string , vol * csi.CreateVolumeResponse , conpubvol * csi.ControllerPublishVolumeResponse ) * csi.NodePublishVolumeResponse {
264
+ nodePublishVolumeWithCapability := func (volumeName string , vol * csi.CreateVolumeResponse , conpubvol * csi.ControllerPublishVolumeResponse , cap * csi. VolumeCapability ) * csi.NodePublishVolumeResponse {
258
265
By ("publishing the volume on a node" )
259
266
var stagingPath string
260
267
if nodeStageSupported {
@@ -264,7 +271,7 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
264
271
VolumeId : vol .GetVolume ().GetVolumeId (),
265
272
TargetPath : sc .TargetPath + "/target" ,
266
273
StagingTargetPath : stagingPath ,
267
- VolumeCapability : TestVolumeCapabilityWithAccessType ( sc , csi . VolumeCapability_AccessMode_SINGLE_NODE_WRITER ) ,
274
+ VolumeCapability : cap ,
268
275
VolumeContext : vol .GetVolume ().GetVolumeContext (),
269
276
Secrets : sc .Secrets .NodePublishVolumeSecret ,
270
277
}
@@ -281,6 +288,9 @@ var _ = DescribeSanity("Node Service", func(sc *TestContext) {
281
288
Expect (nodepubvol ).NotTo (BeNil ())
282
289
return nodepubvol
283
290
}
291
+ nodePublishVolume := func (volumeName string , vol * csi.CreateVolumeResponse , conpubvol * csi.ControllerPublishVolumeResponse ) * csi.NodePublishVolumeResponse {
292
+ return nodePublishVolumeWithCapability (volumeName , vol , conpubvol , TestVolumeCapabilityWithAccessType (sc , csi .VolumeCapability_AccessMode_SINGLE_NODE_WRITER ))
293
+ }
284
294
285
295
BeforeEach (func () {
286
296
cl := csi .NewControllerClient (sc .ControllerConn )
0 commit comments