Skip to content

Commit 4833b7a

Browse files
committed
chore: add one more testcase
1 parent 94a918e commit 4833b7a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: pkg/driver/controller_server_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,20 @@ func TestControllerExpandVolume(t *testing.T) {
317317
expectedError: nil,
318318
expectedSizeGB: 20,
319319
},
320+
{
321+
name: "Desired size not an exact multiple of BytesInGigabyte",
322+
volumeID: "vol-123",
323+
capacityRange: &csi.CapacityRange{
324+
RequiredBytes: 20*driver.BytesInGigabyte + 1, // 20 GB + 1 byte
325+
},
326+
initialVolume: &civogo.Volume{
327+
ID: "vol-123",
328+
SizeGigabytes: 10,
329+
Status: "available",
330+
},
331+
expectedError: nil,
332+
expectedSizeGB: 21, // Desired size should be rounded up to 21 GB
333+
},
320334
{
321335
name: "Volume ID is missing",
322336
volumeID: "",

0 commit comments

Comments
 (0)