Skip to content

Commit 61a129a

Browse files
committed
tests: Lower the expected amount of free space in ext filesystems
With e2fsprogs 1.47.4-1 there are some changes to calculating the size of the orphan inode which makes the tests fail. We don't really need to check the exact value, just make sure we return something that makes sense. Fixes: #1179
1 parent 3617c4e commit 61a129a

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

tests/fs_tests/ext_test.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ def _test_ext_get_info(self, mkfs_function, info_function):
243243
self.assertTrue(fi)
244244
self.assertEqual(fi.block_size, 1024)
245245
self.assertEqual(fi.block_count, self.loop_size / 1024)
246-
# at least 90 % should be available, so it should be reported
247-
self.assertGreater(fi.free_blocks, 0.90 * self.loop_size / 1024)
246+
# at least 50 % should be available, so it should be reported
247+
self.assertGreater(fi.free_blocks, 0.50 * self.loop_size / 1024)
248248
self.assertEqual(fi.label, "")
249249
# should be an non-empty string
250250
self.assertTrue(fi.uuid)
@@ -254,8 +254,8 @@ def _test_ext_get_info(self, mkfs_function, info_function):
254254
fi = BlockDev.fs_ext4_get_info(self.loop_devs[0])
255255
self.assertEqual(fi.block_size, 1024)
256256
self.assertEqual(fi.block_count, self.loop_size / 1024)
257-
# at least 90 % should be available, so it should be reported
258-
self.assertGreater(fi.free_blocks, 0.90 * self.loop_size / 1024)
257+
# at least 50 % should be available, so it should be reported
258+
self.assertGreater(fi.free_blocks, 0.50 * self.loop_size / 1024)
259259
self.assertEqual(fi.label, "")
260260
# should be an non-empty string
261261
self.assertTrue(fi.uuid)
@@ -344,8 +344,6 @@ def _test_ext_resize(self, mkfs_function, info_function, resize_function, minsiz
344344
self.assertTrue(fi)
345345
self.assertEqual(fi.block_size, 1024)
346346
self.assertEqual(fi.block_count, self.loop_size / 1024)
347-
# at least 90 % should be available, so it should be reported
348-
self.assertGreater(fi.free_blocks, 0.90 * self.loop_size / 1024)
349347

350348
succ = resize_function(self.loop_devs[0], 50 * 1024**2, None)
351349
self.assertTrue(succ)
@@ -361,8 +359,6 @@ def _test_ext_resize(self, mkfs_function, info_function, resize_function, minsiz
361359
self.assertTrue(fi)
362360
self.assertEqual(fi.block_size, 1024)
363361
self.assertEqual(fi.block_count, self.loop_size / 1024)
364-
# at least 90 % should be available, so it should be reported
365-
self.assertGreater(fi.free_blocks, 0.90 * self.loop_size / 1024)
366362

367363
# resize again
368364
succ = resize_function(self.loop_devs[0], 50 * 1024**2, None)
@@ -379,8 +375,6 @@ def _test_ext_resize(self, mkfs_function, info_function, resize_function, minsiz
379375
self.assertTrue(fi)
380376
self.assertEqual(fi.block_size, 1024)
381377
self.assertEqual(fi.block_count, self.loop_size / 1024)
382-
# at least 90 % should be available, so it should be reported
383-
self.assertGreater(fi.free_blocks, 0.90 * self.loop_size / 1024)
384378

385379
# get min size and resize to it
386380
size = minsize_function(self.loop_devs[0])

0 commit comments

Comments
 (0)