@@ -80,7 +80,6 @@ const (
80
80
)
81
81
82
82
var _ = Describe ("GCE PD CSI Driver" , func () {
83
-
84
83
It ("Should get reasonable volume limits from nodes with NodeGetInfo" , func () {
85
84
testContext := getRandomTestContext ()
86
85
resp , err := testContext .Client .NodeGetInfo ()
@@ -284,6 +283,7 @@ var _ = Describe("GCE PD CSI Driver", func() {
284
283
Expect (err ).To (BeNil (), "Could not find disk in correct zone" )
285
284
}
286
285
})
286
+
287
287
// TODO(hime): Enable this test once all release branches contain the fix from PR#1708.
288
288
// It("Should return InvalidArgument when disk size exceeds limit", func() {
289
289
// // If this returns a different error code (like Unknown), the error wrapping logic in #1708 has regressed.
@@ -907,30 +907,26 @@ var _ = Describe("GCE PD CSI Driver", func() {
907
907
908
908
It ("Should create and delete multi-writer disk" , func () {
909
909
Expect (testContexts ).ToNot (BeEmpty ())
910
- testContext := getRandomTestContext ()
910
+ testContext := getRandomMwTestContext ()
911
911
912
- p , _ , _ := testContext .Instance .GetIdentity ()
912
+ p , z , _ := testContext .Instance .GetIdentity ()
913
913
client := testContext .Client
914
-
915
- // Hardcode to us-east1-a while feature is in alpha
916
- zone := "us-east1-a"
917
-
918
914
// Create and Validate Disk
919
- volName , volID := createAndValidateUniqueZonalMultiWriterDisk (client , p , zone , hdbDiskType )
915
+ volName , volID := createAndValidateUniqueZonalMultiWriterDisk (client , p , z , hdbDiskType )
920
916
921
917
defer func () {
922
918
// Delete Disk
923
919
err := client .DeleteVolume (volID )
924
920
Expect (err ).To (BeNil (), "DeleteVolume failed" )
925
921
926
922
// Validate Disk Deleted
927
- _ , err = computeAlphaService .Disks .Get (p , zone , volName ).Do ()
923
+ _ , err = computeService .Disks .Get (p , z , volName ).Do ()
928
924
Expect (gce .IsGCEError (err , "notFound" )).To (BeTrue (), "Expected disk to not be found" )
929
925
}()
930
926
})
931
927
932
928
It ("Should complete entire disk lifecycle with multi-writer disk" , func () {
933
- testContext := getRandomTestContext ()
929
+ testContext := getRandomMwTestContext ()
934
930
935
931
p , z , _ := testContext .Instance .GetIdentity ()
936
932
client := testContext .Client
@@ -1787,7 +1783,6 @@ func createAndValidateUniqueZonalMultiWriterDisk(client *remote.CsiClient, proje
1787
1783
disk := typeToDisk [diskType ]
1788
1784
1789
1785
disk .params [common .ParameterAccessMode ] = "READ_WRITE_MANY"
1790
-
1791
1786
volName := testNamePrefix + string (uuid .NewUUID ())
1792
1787
volume , err := client .CreateVolumeWithCaps (volName , disk .params , defaultMwSizeGb ,
1793
1788
& csi.TopologyRequirement {
@@ -1815,12 +1810,9 @@ func createAndValidateUniqueZonalMultiWriterDisk(client *remote.CsiClient, proje
1815
1810
Expect (cloudDisk .Status ).To (Equal (readyState ))
1816
1811
Expect (cloudDisk .SizeGb ).To (Equal (defaultMwSizeGb ))
1817
1812
Expect (cloudDisk .Name ).To (Equal (volName ))
1813
+ Expect (cloudDisk .AccessMode ).To (Equal ("READ_WRITE_MANY" ))
1818
1814
disk .validate (cloudDisk )
1819
1815
1820
- alphaDisk , err := computeAlphaService .Disks .Get (project , zone , volName ).Do ()
1821
- Expect (err ).To (BeNil (), "Failed to get cloud disk using alpha API" )
1822
- Expect (alphaDisk .MultiWriter ).To (Equal (true ))
1823
-
1824
1816
return volName , volume .VolumeId
1825
1817
}
1826
1818
0 commit comments