diff --git a/service/service_unit_test.go b/service/service_unit_test.go index 712dcebf..005c79a1 100644 --- a/service/service_unit_test.go +++ b/service/service_unit_test.go @@ -116,10 +116,10 @@ func TestGetVolSize(t *testing.T) { { // Requesting a size of 8.5 GiB to test rounding up cr: &csi.CapacityRange{ - RequiredBytes: int64(8.5 * float64(bytesInGiB)), + RequiredBytes: int64(48.8 * float64(bytesInGiB)), LimitBytes: 0, }, - sizeKiB: 16 * kiBytesInGiB, + sizeKiB: 56 * kiBytesInGiB, }, } diff --git a/test/integration/features/integration.feature b/test/integration/features/integration.feature index 0c4a4969..0a8d06dd 100644 --- a/test/integration/features/integration.feature +++ b/test/integration/features/integration.feature @@ -37,6 +37,15 @@ Feature: VxFlex OS CSI interface And when I call DeleteVolume Then there are no errors + Scenario: Create and delete basic volume with float size + Given a VxFlexOS service + And a basic block volume request "integration1" "48.1" + When I call CreateVolume + When I call ListVolume + Then a valid ListVolumeResponse is returned + And when I call DeleteVolume + Then there are no errors + Scenario: Idempotent create and delete basic volume Given a VxFlexOS service And a basic block volume request "integration2" "8" diff --git a/test/integration/step_defs_test.go b/test/integration/step_defs_test.go index 180b456c..cc900ff5 100644 --- a/test/integration/step_defs_test.go +++ b/test/integration/step_defs_test.go @@ -331,7 +331,7 @@ func (f *feature) aVxFlexOSService() error { return nil } -func (f *feature) aBasicBlockVolumeRequest(name string, size int64) error { +func (f *feature) aBasicBlockVolumeRequest(name string, size float64) error { req := new(csi.CreateVolumeRequest) storagePool := os.Getenv("STORAGE_POOL") params := make(map[string]string) @@ -344,7 +344,7 @@ func (f *feature) aBasicBlockVolumeRequest(name string, size int64) error { makeAUniqueName(&name) req.Name = name capacityRange := new(csi.CapacityRange) - capacityRange.RequiredBytes = size * 1024 * 1024 * 1024 + capacityRange.RequiredBytes = int64(math.Ceil(size * 1024 * 1024 * 1024)) req.CapacityRange = capacityRange capability := new(csi.VolumeCapability) block := new(csi.VolumeCapability_BlockVolume) @@ -2737,7 +2737,7 @@ func (f *feature) checkNFS(_ context.Context, systemID string) (bool, error) { func FeatureContext(s *godog.ScenarioContext) { f := &feature{} s.Step(`^a VxFlexOS service$`, f.aVxFlexOSService) - s.Step(`^a basic block volume request "([^"]*)" "(\d+)"$`, f.aBasicBlockVolumeRequest) + s.Step(`^a basic block volume request "([^"]*)" "(\d+(\.\d+)?)"$`, f.aBasicBlockVolumeRequest) s.Step(`^Set System Name As "([^"]*)"$`, f.iSetSystemName) s.Step(`^Set Bad AllSystemNames$`, f.iSetBadAllSystemNames) s.Step(`^I call CreateVolume$`, f.iCallCreateVolume)