[PATCH 00/14] test: Convert tests to use FsHelper and DiskHelper

Simon Glass sjg at chromium.org
Sat Apr 4 16:03:04 CEST 2026


This series adds a DiskHelper class and converts most test code to use
FsHelper and DiskHelper instead of calling mk_fs() and setup_image()
directly.

The FsHelper class (already upstream) provides a cleaner interface for
creating filesystem images, handling temporary directories and cleanup
automatically. The new DiskHelper class builds on this, creating
partitioned disk images from one or more FsHelper filesystems.

DiskHelper includes a cur_dir flag to place the disk image in the
current directory rather than 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 needed for
now and should be removed in a follow-up once all tests are migrated to
use the persistent-data directory instead.

With these helpers, test-setup code becomes shorter, more consistent and
easier to follow. Manual sfdisk/dd/cleanup sequences are replaced by a
few method calls.

The series also fixes a broken fs_obj_fat fixture where a stale
size_gran argument is silently causing the test to be skipped.

A few EFI test fixtures (efi_capsule, efi_secboot, eficonfig) still use
mk_fs() directly; these are left for a follow-up series since they would
benefit from a full DiskHelper conversion.


Simon Glass (14):
  test: Add a helper class to create disk images
  test: fs_helper: Skip empty srcdir when creating a filesystem
  test: Fix broken fs_obj_fat fixture
  test: Convert test_cat to use FsHelper
  test: Convert test_xxd to use FsHelper
  test: Convert test_efi_bootmgr to use FsHelper
  test: Convert setup_bootmenu_image() to use FsHelper
  test: Split out core of Fedora image into a new function
  test: Convert setup_bootflow_image() to use FsHelper
  test: Convert setup_efi_image() to use FsHelper
  test: Convert test_ut_dm_init() to use FsHelper
  test: Rename setup_bootflow_image()
  test: Convert setup_rauc_image() to use FsHelper
  test: Convert test_fs fixtures to use FsHelper

 test/py/tests/fs_helper.py        |  95 +++++++++++++-
 test/py/tests/test_cat.py         |  27 ++--
 test/py/tests/test_efi_bootmgr.py |  38 +++---
 test/py/tests/test_fs/conftest.py | 198 ++++++++++--------------------
 test/py/tests/test_ut.py          | 190 +++++++++++++++-------------
 test/py/tests/test_xxd.py         |  28 ++---
 6 files changed, 288 insertions(+), 288 deletions(-)

-- 
2.43.0

base-commit: 1c1bfb1cf34bbb2a5717eb6995c55093279f9341
branch: testfsa


More information about the U-Boot mailing list