]> git.ipfire.org Git - thirdparty/u-boot.git/commit
test: fs: Use shared generate_file from utils
authorAristo Chen <aristo.chen@canonical.com>
Mon, 11 May 2026 08:58:50 +0000 (08:58 +0000)
committerTom Rini <trini@konsulko.com>
Mon, 25 May 2026 19:43:21 +0000 (13:43 -0600)
commite9848e30bd88bf889ef74799dab6c2a2a0628890
treee77712abba2b72a55df262d7e9be5d51cac56585
parent7bb1917b15b77a7d8c27045df33b6bbc214c2f67
test: fs: Use shared generate_file from utils

test_fs/test_erofs.py and test_fs/test_squashfs/sqfs_common.py both
defined a generate_file() helper that writes a file of a given size
filled with 'x'. The two functions were functionally identical and
differed only in parameter names and docstrings.

Move the helper into the existing test/py/utils.py module, which is
the established home for generic test utilities (md5sum_file,
PersistentRandomFile, attempt_to_open_file). Update both call sites
to use it.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: joaomarcos.costa@bootlin.com
Reviewed-by: Simon Glass <sjg@chromium.org>
test/py/tests/test_fs/test_erofs.py
test/py/tests/test_fs/test_squashfs/sqfs_common.py
test/py/utils.py