Skip to content

Commit 5cc8f54

Browse files
authored
Merge pull request #262 from NicolasT/capacity-zero
sanity: allow `Volume` `capacity_bytes` to be zero
2 parents b91f254 + 8e223cb commit 5cc8f54

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/sanity/controller.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *TestCo
482482
Expect(vol.GetVolume()).NotTo(BeNil())
483483
Expect(vol.GetVolume().GetVolumeId()).NotTo(BeEmpty())
484484
cl.RegisterVolume(name, VolumeInfo{VolumeID: vol.GetVolume().GetVolumeId()})
485-
Expect(vol.GetVolume().GetCapacityBytes()).To(BeNumerically(">=", TestVolumeSize(sc)))
485+
Expect(vol.GetVolume().GetCapacityBytes()).To(Or(BeNumerically(">=", TestVolumeSize(sc)), BeZero()))
486486

487487
By("cleaning up deleting the volume")
488488

@@ -521,7 +521,7 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *TestCo
521521
Expect(vol1.GetVolume()).NotTo(BeNil())
522522
Expect(vol1.GetVolume().GetVolumeId()).NotTo(BeEmpty())
523523
cl.RegisterVolume(name, VolumeInfo{VolumeID: vol1.GetVolume().GetVolumeId()})
524-
Expect(vol1.GetVolume().GetCapacityBytes()).To(BeNumerically(">=", size))
524+
Expect(vol1.GetVolume().GetCapacityBytes()).To(Or(BeNumerically(">=", size), BeZero()))
525525

526526
vol2, err := c.CreateVolume(
527527
context.Background(),
@@ -541,7 +541,7 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *TestCo
541541
Expect(vol2).NotTo(BeNil())
542542
Expect(vol2.GetVolume()).NotTo(BeNil())
543543
Expect(vol2.GetVolume().GetVolumeId()).NotTo(BeEmpty())
544-
Expect(vol2.GetVolume().GetCapacityBytes()).To(BeNumerically(">=", size))
544+
Expect(vol2.GetVolume().GetCapacityBytes()).To(Or(BeNumerically(">=", size), BeZero()))
545545
Expect(vol1.GetVolume().GetVolumeId()).To(Equal(vol2.GetVolume().GetVolumeId()))
546546

547547
By("cleaning up deleting the volume")
@@ -646,7 +646,7 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *TestCo
646646
Expect(vol.GetVolume()).NotTo(BeNil())
647647
Expect(vol.GetVolume().GetVolumeId()).NotTo(BeEmpty())
648648
cl.RegisterVolume(name, VolumeInfo{VolumeID: vol.GetVolume().GetVolumeId()})
649-
Expect(vol.GetVolume().GetCapacityBytes()).To(BeNumerically(">=", size))
649+
Expect(vol.GetVolume().GetCapacityBytes()).To(Or(BeNumerically(">=", size), BeZero()))
650650

651651
By("cleaning up deleting the volume")
652652

0 commit comments

Comments
 (0)