Re: [PATCH v1 1/1] test: fs: Use shared generate_file from utils

Simon Glass <[email protected]>
Newsgroups org.ozlabs.lists.linux-erofs,org.u-boot-project.lists.u-boot
Message-ID <CAFLszTj8kmRyf5_GrcP2zKRxouCwr3BNoPOk6GWse8RRVQ2BJg@mail.gmail.com>
On 2026-05-11T08:58:50, Aristo Chen <[email protected]> wrote:
> 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 <[email protected]>
>
> test/py/tests/test_fs/test_erofs.py                | 16 ++++------------
>  test/py/tests/test_fs/test_squashfs/sqfs_common.py | 22 +++++-----------------
>  test/py/utils.py                                   | 13 +++++++++++++
>  3 files changed, 22 insertions(+), 29 deletions(-)

Reviewed-by: Simon Glass <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.