<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/test/py/tests/fs_helper.py, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/test/py/tests/fs_helper.py?h=main</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/test/py/tests/fs_helper.py?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-06-02T23:29:22Z</updated>
<entry>
<title>tests: fs_helper: check path validity during cleanup</title>
<updated>2026-06-02T23:29:22Z</updated>
<author>
<name>Francesco Valla</name>
<email>francesco@valla.it</email>
</author>
<published>2026-05-31T21:15:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b353d523a86775663ca2eebcd4741f3f3a9b1fe4'/>
<id>urn:sha1:b353d523a86775663ca2eebcd4741f3f3a9b1fe4</id>
<content type='text'>
If the filesystem creation attempted by the FsHelper class fails, the
invocation of the cleanup function will cause a TypeError exception,
because the path of the filesystem itself, fed to os.remove(), will be
None. This will lead to a test failure even in case a skip is instead
wanted.

Such an exception will lead to a backtrace like this:

  test/py/tests/test_fs/conftest.py:269: in fs_obj_basic
      fsh.mk_fs()
  test/py/tests/fs_helper.py:70: in mk_fs
      self.fs_img = mk_fs(self.config, self.fs_type, self.size_mb &lt;&lt; 20,
  test/py/tests/fs_helper.py:246: in mk_fs
      check_call(f'mkfs.{fs_lnxtype} {mkfs_opt} {fs_img}', shell=True,
  /usr/lib64/python3.14/subprocess.py:420: in check_call
      raise CalledProcessError(retcode, cmd)
  E   subprocess.CalledProcessError: Command '&lt;...&gt;' returned non-zero exit status 1.

  During handling of the above exception, another exception occurred:
  test/py/tests/test_fs/conftest.py:272: in fs_obj_basic
      pytest.skip('Setup failed for filesystem: ' + fs_type + '. {}'.format(err))
  E   Skipped: Setup failed for filesystem: ext4. Command '&lt;...&gt;' returned non-zero exit status 1.

  During handling of the above exception, another exception occurred:
  test/py/tests/test_fs/conftest.py:277: in fs_obj_basic
      fsh.cleanup()
  test/py/tests/fs_helper.py:91: in cleanup
      os.remove(self.fs_img)
  E   TypeError: remove: path should be string, bytes or os.PathLike, not NoneType

Fix this by checking if the variable containing the filesystem path is
valid before attempting to call os.remove() on it.

Fixes: 3691b1e4ce074 ("test: Convert fs_helper to use a class")
Signed-off-by: Francesco Valla &lt;francesco@valla.it&gt;
</content>
</entry>
<entry>
<title>test: fs_helper: Skip empty srcdir when creating a filesystem</title>
<updated>2026-04-21T21:30:38Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2026-04-04T14:03:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4e1793b1fb21e3896cf018fc35fc2c9c3e202138'/>
<id>urn:sha1:4e1793b1fb21e3896cf018fc35fc2c9c3e202138</id>
<content type='text'>
FsHelper.mk_fs() always creates a srcdir via setup(), then passes it
to the module-level mk_fs(). This fails for filesystem types like ext2
that do not support the -d flag, raising ValueError even when no files
need to be copied.

Pass None for src_dir when the srcdir is empty, so that creating an
empty filesystem works for all supported types.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>test: Add a helper class to create disk images</title>
<updated>2026-04-21T21:30:38Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2026-04-04T14:03:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7c69117337412d2477bc3f72e4042bca4a4e66b3'/>
<id>urn:sha1:7c69117337412d2477bc3f72e4042bca4a4e66b3</id>
<content type='text'>
Provide a way to create disk images which consist of multiple filesystem
images.

Include a cur_dir option to place the disk image in the current
directory rather than in the persistent-data directory. This matches the
behaviour of setup_image() which places disk images in source_dir where
sandbox expects to find them. This flag is a temporary feature and
should be removed once all tests are migrated to use the persistent-data
directory instead.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>test: Convert fs_helper to use a class</title>
<updated>2026-03-23T15:18:30Z</updated>
<author>
<name>Simon Glass</name>
<email>simon.glass@canonical.com</email>
</author>
<published>2026-03-09T15:13:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3691b1e4ce07425dfe3a32c10cfcaf989be57734'/>
<id>urn:sha1:3691b1e4ce07425dfe3a32c10cfcaf989be57734</id>
<content type='text'>
Create a class around mk_fs() (and later setup_image()) to handle the
common tasks of image creation. Many callers of fs_helper.mk_fs()
create their own scratch directories while users of
fs_helper.setup_image() rely on one being returned. Unify this by
adding 'srcdir' as a field while converting to a class.

The class delegates to the existing mk_fs() function for the actual
filesystem creation, adding lifecycle management for scratch
directories and the image file.

Signed-off-by: Simon Glass &lt;simon.glass@canonical.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>test: fs_helper: Drop the size_gran argument</title>
<updated>2026-03-23T15:18:30Z</updated>
<author>
<name>Simon Glass</name>
<email>simon.glass@canonical.com</email>
</author>
<published>2026-03-09T15:13:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d030dc34d67acaa51742d549cb83a81256fefac2'/>
<id>urn:sha1:d030dc34d67acaa51742d549cb83a81256fefac2</id>
<content type='text'>
Nothing uses this argument, so make it a constant for now.

Signed-off-by: Simon Glass &lt;simon.glass@canonical.com&gt;
Reviewed-by: Christian Taedcke &lt;christian.taedcke@weidmueller.com&gt;
</content>
</entry>
<entry>
<title>test: Update comment for fs_helper.setup_image()</title>
<updated>2026-03-23T15:18:30Z</updated>
<author>
<name>Simon Glass</name>
<email>simon.glass@canonical.com</email>
</author>
<published>2026-03-09T15:13:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ffaa324c895fc37d73f7ea070e0a8feda9da4174'/>
<id>urn:sha1:ffaa324c895fc37d73f7ea070e0a8feda9da4174</id>
<content type='text'>
This function actually allows creating two partitions now, so update its
comment to match that.

Signed-off-by: Simon Glass &lt;simon.glass@canonical.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>test: fs_helper: Add a quiet flag to mk_fs()</title>
<updated>2026-03-23T15:18:29Z</updated>
<author>
<name>Simon Glass</name>
<email>simon.glass@canonical.com</email>
</author>
<published>2026-03-09T15:13:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=23e9906192b86f3a0bddf02ef4ef6bfd2e6fa104'/>
<id>urn:sha1:23e9906192b86f3a0bddf02ef4ef6bfd2e6fa104</id>
<content type='text'>
In many cases callers only want to see warnings and errors from the
filesystem-creation tools, not their normal output.

Add a quiet parameter to mk_fs() that suppresses the output of mkfs
and switches mcopy from verbose to quiet mode.

Signed-off-by: Simon Glass &lt;simon.glass@canonical.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>test: fs_helper: Allow passing the image filename</title>
<updated>2026-03-23T15:18:29Z</updated>
<author>
<name>Simon Glass</name>
<email>simon.glass@canonical.com</email>
</author>
<published>2026-03-09T15:13:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fade4112dad0fcb4c4c5610582ef1edec8d70ddc'/>
<id>urn:sha1:fade4112dad0fcb4c4c5610582ef1edec8d70ddc</id>
<content type='text'>
The mk_fs() function always generates its own image filename from the
prefix and fs_type. Some callers need to specify a custom leaf name
while still keeping the image under the persistent-data directory.

Add an fs_img parameter that accepts a leaf filename. When provided,
it is joined with persistent_data_dir instead of the default name.

Signed-off-by: Simon Glass &lt;simon.glass@canonical.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>Merge patch series "Improve pytest runtime"</title>
<updated>2025-04-08T19:54:50Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-04-08T19:54:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a30b54462825843a9dcc46a17df6d57099f7b61a'/>
<id>urn:sha1:a30b54462825843a9dcc46a17df6d57099f7b61a</id>
<content type='text'>
Tom Rini &lt;trini@konsulko.com&gt; says:

One thing that Simon Glass has noted is that our pytest run time keeps
getting longer. Looking at:
https://source.denx.de/u-boot/u-boot/-/pipelines/25011/test_report?job_name=sandbox%20test.py%3A%20%5Bfast%20amd64%5D
we can see that some of the longest running tests are a little puzzling.
It turns out that we have two ways of making filesystem images without
requiring root access and one of them is significantly slower than the
other. This series changes us from using virt-make-fs to only using the
mk_fs helper that currently resides in test_ut.py which uses standard
userspace tools. The final result can be seen at:
https://source.denx.de/u-boot/u-boot/-/pipelines/25015/test_report?job_name=sandbox%20test.py%3A%20%5Bfast%20amd64%5D
and the tests changed here now run much quicker.

Link: https://lore.kernel.org/r/20250320140030.2052434-1-trini@konsulko.com
</content>
</entry>
<entry>
<title>test/py: Fix a problem with setup_image</title>
<updated>2025-04-08T19:51:09Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-03-20T13:59:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2c092875abfd9269a34b3cc03930066fda53a476'/>
<id>urn:sha1:2c092875abfd9269a34b3cc03930066fda53a476</id>
<content type='text'>
While we can be passed an image size to use, we always called qemu-img
with 20M as the size. Fix this by using the size parameter.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
</feed>
