action #117511
openTake into account units when using library filesystem_utils in snapper_cleanup_timeline
0%
Description
Motivation¶
The convert2numeric subroutine is completely agnostic to size units. In the actual run this means:
$disk_size = 38
(Gigabytes).$group_space =16.88
(Megabytes)$space_limit = 0.2
(20 %)
So luckily with this numbers the test in line 44 results in false
.
Subroutine convert2numeric
does what is supposed to do, therefore we need to extend functionality when suing df -h
in library filesystem_utils
, otherwise we compare Megabytes with Gigabytes which is obviously wrong. However you do this, keep an eye on where the values are used, because this might affect the $block_number
variable used in the dd
command.
Acceptance criteria¶
AC1: Take into account units when getting partition size with library filesystem_utils
Additional information¶
We could also discuss, if the test in line 44 is really needed in this test module. Current disk usages by snapshots is 16.88 Megabytes compared to 38 Gigabytes of disk size. This test module is only used in the snapper_cleanup_timeline
test suite which is chained directly after create_hdd_textmode
, so the chances are low that we run into a situation where snapshots occupy more than 50% of the disk space.