Skip to content

Commit 6602735

Browse files
feat: migrate volume API group to library model
1 parent abf4245 commit 6602735

File tree

7 files changed

+1325
-54
lines changed

7 files changed

+1325
-54
lines changed

integrationtests/utils.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,17 @@ func diskInit(t *testing.T) (*VirtualHardDisk, func()) {
274274
return vhd, cleanup
275275
}
276276

277+
// sizeIsAround returns true if the actual size is around the expected size
278+
// (considers the fact that some bytes were lost)
279+
func sizeIsAround(t *testing.T, actualSize, expectedSize int64) bool {
280+
// An upper bound on the number of bytes that are lost when creating or resizing a partition
281+
var volumeSizeBytesLoss int64 = (20 * 1024 * 1024)
282+
var lowerBound = expectedSize - volumeSizeBytesLoss
283+
var upperBound = expectedSize
284+
t.Logf("Checking that the size is inside the bounds: %d < (actual) %d < %d", lowerBound, actualSize, upperBound)
285+
return lowerBound <= actualSize && actualSize <= upperBound
286+
}
287+
277288
func pathExists(path string) (bool, error) {
278289
_, err := os.Stat(path)
279290
if err == nil {

0 commit comments

Comments
 (0)