test/py: Correct sizing of created disks
authorSimon Glass <sjg@chromium.org>
Sat, 15 Mar 2025 14:25:49 +0000 (14:25 +0000)
committerTom Rini <trini@konsulko.com>
Thu, 3 Apr 2025 17:41:55 +0000 (11:41 -0600)
commit0b9e517aafc2cfa1b5ab1af2b82983fd895b7be3
tree2729c7dbe7a902ba795a09ca72471d28a6ffe4cd
parentb23f0a42c33569298011ae643babfd2609ecf40a
test/py: Correct sizing of created disks

At present the disks end up being 1MB shorter than they should be,
since dd truncates by default.

Move the code into a function and update it to avoid truncation.

This resolves various warnings when running sandbox tests, of the form:

   mmc_bread() MMC: block number 0x9801 exceeds max(0x9800)

caused by the FAT partition being scanning.

Signed-off-by: Simon Glass <sjg@chromium.org>
test/py/tests/test_ut.py