@@ -2647,6 +2647,32 @@ func TestOntapASAStorageDriver_Resize_LesserSizeThanCurrent(t *testing.T) {
26472647 assert .Error (t , err , "Expected error when resizing to lesser size than current" )
26482648}
26492649
2650+ func TestOntapASANVMeStorageDriver_Resize_DriverVolumeLimitError (t * testing.T ) {
2651+ mockAPI , driver := newMockOntapASADriver (t )
2652+
2653+ volConfig := getASAVolumeConfig ()
2654+
2655+ // Case: Invalid limitVolumeSize on driver
2656+ driver .Config .LimitVolumeSize = "1000.1000"
2657+
2658+ mockAPI .EXPECT ().LunExists (ctx , "trident-pvc-1234" ).Return (true , nil )
2659+
2660+ err := driver .Resize (ctx , & volConfig , 2147483648 ) // 1GB
2661+
2662+ assert .ErrorContains (t , err , "error parsing limitVolumeSize" )
2663+
2664+ // Case: requestedSize is more than limitVolumeSize
2665+ driver .Config .LimitVolumeSize = "2147483648" // 2 GB
2666+
2667+ mockAPI .EXPECT ().LunExists (ctx , "trident-pvc-1234" ).Return (true , nil )
2668+
2669+ err = driver .Resize (ctx , & volConfig , 3221225472 ) // 3 GB
2670+
2671+ capacityErr , _ := errors .HasUnsupportedCapacityRangeError (err )
2672+
2673+ assert .True (t , capacityErr , "expected unsupported capacity error" )
2674+ }
2675+
26502676func TestOntapASAStorageDriver_Resize_APIErrors (t * testing.T ) {
26512677 mockAPI , driver := newMockOntapASADriver (t )
26522678
0 commit comments