@@ -236,7 +236,7 @@ func TestCreateSnapshotArguments(t *testing.T) {
236
236
gce .CloudDiskFromV1 (& compute.Disk {
237
237
Name : name ,
238
238
SelfLink : fmt .Sprintf ("https://www.googleapis.com/compute/v1/projects/project/regions/country-region/name/%s" , name ),
239
- Type : common .ParameterHdHADiskType ,
239
+ Type : common .DiskTypeHdHA ,
240
240
Region : "country-region" ,
241
241
}),
242
242
},
@@ -253,7 +253,7 @@ func TestCreateSnapshotArguments(t *testing.T) {
253
253
gce .CloudDiskFromV1 (& compute.Disk {
254
254
Name : name ,
255
255
SelfLink : fmt .Sprintf ("https://www.googleapis.com/compute/v1/projects/project/regions/country-region/name/%s" , name ),
256
- Type : common .ParameterHdHADiskType ,
256
+ Type : common .DiskTypeHdHA ,
257
257
Region : "country-region" ,
258
258
}),
259
259
},
@@ -276,7 +276,7 @@ func TestCreateSnapshotArguments(t *testing.T) {
276
276
gce .CloudDiskFromV1 (& compute.Disk {
277
277
Name : name ,
278
278
SelfLink : fmt .Sprintf ("https://www.googleapis.com/compute/v1/projects/project/regions/country-region/name/%s" , name ),
279
- Type : common .ParameterHdHADiskType ,
279
+ Type : common .DiskTypeHdHA ,
280
280
AccessMode : common .GCEReadWriteManyAccessMode ,
281
281
Region : "country-region" ,
282
282
}),
@@ -921,7 +921,7 @@ func TestCreateVolumeArguments(t *testing.T) {
921
921
Name : name ,
922
922
CapacityRange : stdCapRange ,
923
923
VolumeCapabilities : stdVolCaps ,
924
- Parameters : map [string ]string {common .ParameterKeyType : common .ParameterHdHADiskType },
924
+ Parameters : map [string ]string {common .ParameterKeyType : common .DiskTypeHdHA },
925
925
AccessibilityRequirements : & csi.TopologyRequirement {
926
926
Preferred : []* csi.Topology {
927
927
{
@@ -954,7 +954,7 @@ func TestCreateVolumeArguments(t *testing.T) {
954
954
CapacityRange : stdCapRange ,
955
955
VolumeCapabilities : stdVolCaps ,
956
956
Parameters : map [string ]string {
957
- common .ParameterKeyType : common .ParameterHdHADiskType ,
957
+ common .ParameterKeyType : common .DiskTypeHdHA ,
958
958
},
959
959
AccessibilityRequirements : & csi.TopologyRequirement {
960
960
Requisite : []* csi.Topology {
@@ -978,7 +978,7 @@ func TestCreateVolumeArguments(t *testing.T) {
978
978
CapacityRange : stdCapRange ,
979
979
VolumeCapabilities : stdVolCaps ,
980
980
Parameters : map [string ]string {
981
- common .ParameterKeyType : common .ParameterHdHADiskType ,
981
+ common .ParameterKeyType : common .DiskTypeHdHA ,
982
982
},
983
983
},
984
984
expVol : & csi.Volume {
@@ -1262,6 +1262,42 @@ func TestCreateVolumeArguments(t *testing.T) {
1262
1262
CapacityBytes : MinimumVolumeSizeInBytes ,
1263
1263
},
1264
1264
},
1265
+ {
1266
+ name : "fail with hyperdisk-throughput access mode ROX" ,
1267
+ req : & csi.CreateVolumeRequest {
1268
+ Name : name ,
1269
+ Parameters : map [string ]string {"type" : "hyperdisk-throughput" },
1270
+ VolumeCapabilities : []* csi.VolumeCapability {
1271
+ {
1272
+ AccessType : & csi.VolumeCapability_Block {
1273
+ Block : & csi.VolumeCapability_BlockVolume {},
1274
+ },
1275
+ AccessMode : & csi.VolumeCapability_AccessMode {
1276
+ Mode : csi .VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY ,
1277
+ },
1278
+ },
1279
+ },
1280
+ },
1281
+ expErrCode : codes .InvalidArgument ,
1282
+ },
1283
+ {
1284
+ name : "fail with hyperdisk-extreme access mode RWX" ,
1285
+ req : & csi.CreateVolumeRequest {
1286
+ Name : name ,
1287
+ Parameters : map [string ]string {"type" : "hyperdisk-extreme" },
1288
+ VolumeCapabilities : []* csi.VolumeCapability {
1289
+ {
1290
+ AccessType : & csi.VolumeCapability_Block {
1291
+ Block : & csi.VolumeCapability_BlockVolume {},
1292
+ },
1293
+ AccessMode : & csi.VolumeCapability_AccessMode {
1294
+ Mode : csi .VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER ,
1295
+ },
1296
+ },
1297
+ },
1298
+ },
1299
+ expErrCode : codes .InvalidArgument ,
1300
+ },
1265
1301
}
1266
1302
1267
1303
// Run test cases
@@ -2454,8 +2490,9 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
2454
2490
resp , err := gceDriver .cs .CreateVolume (context .Background (), tc .createReq )
2455
2491
if err != nil {
2456
2492
t .Errorf ("Expected no error, got %v" , err )
2493
+ } else {
2494
+ volId = resp .GetVolume ().VolumeId
2457
2495
}
2458
- volId = resp .GetVolume ().VolumeId
2459
2496
}
2460
2497
2461
2498
tc .modifyReq .VolumeId = volId
@@ -3047,7 +3084,7 @@ func TestCloningLocationRequirements(t *testing.T) {
3047
3084
sourceVolumeID : testZonalVolumeSourceID ,
3048
3085
requestCapacityRange : stdCapRange ,
3049
3086
reqParameters : map [string ]string {
3050
- common .ParameterKeyType : common .ParameterHdHADiskType ,
3087
+ common .ParameterKeyType : common .DiskTypeHdHA ,
3051
3088
},
3052
3089
cloneIsRegional : true ,
3053
3090
expectedLocationRequirements : & locationRequirements {srcVolRegion : region , srcVolZone : zone , srcIsRegional : false , cloneIsRegional : true },
0 commit comments