From 2102769c1441e0dfb4cffca5847423c4033dee1a Mon Sep 17 00:00:00 2001 From: Alexander Wels Date: Fri, 7 Jan 2022 08:29:13 -0600 Subject: [PATCH] Allow greater or equal in storage provisioning check The current check enforces that a dynamic provisioner creates persistent volumes of capacity equals to the persistent volume claim request size. However there are provisioners that will create persistent volumes with a capacity greater than the request size (cinder comes to mind which increments in 1Gi increments, so if you request 0.5Gi, you get 1Gi). Also provisioners that have shared storage should be reporting the total space not the request size (nfs/hostpath for instance). All these will fail the provisioning check currently because the capacity is > than the request size. This modifies the check to be capacity >= request size. Signed-off-by: Alexander Wels --- test/e2e/storage/testsuites/provisioning.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/storage/testsuites/provisioning.go b/test/e2e/storage/testsuites/provisioning.go index 14020482f9d..e1526403e92 100644 --- a/test/e2e/storage/testsuites/provisioning.go +++ b/test/e2e/storage/testsuites/provisioning.go @@ -474,11 +474,11 @@ func (t StorageClassTest) checkProvisioning(client clientset.Interface, claim *v // Check sizes expectedCapacity := resource.MustParse(t.ExpectedSize) pvCapacity := pv.Spec.Capacity[v1.ResourceName(v1.ResourceStorage)] - framework.ExpectEqual(pvCapacity.Value(), expectedCapacity.Value(), "pvCapacity is not equal to expectedCapacity") + gomega.Expect(pvCapacity.Value()).To(gomega.BeNumerically(">=", expectedCapacity.Value), "pvCapacity is not greater or equal to expectedCapacity") requestedCapacity := resource.MustParse(t.ClaimSize) claimCapacity := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] - framework.ExpectEqual(claimCapacity.Value(), requestedCapacity.Value(), "claimCapacity is not equal to requestedCapacity") + gomega.Expect(claimCapacity.Value()).To(gomega.BeNumerically(">=", requestedCapacity.Value), "claimCapacity is not greater or equal to requestedCapacity") // Check PV properties ginkgo.By("checking the PV")