Skip to content

test: Convert tests to use FsHelper and DiskHelper

Simon Glass u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14test: Add a helper class to create disk imagestest/py/tests/fs_helper.py+92 -00 replies
2/14test: fs_helper: Skip empty srcdir when creating a filesystemtest/py/tests/fs_helper.py+2 -10 replies
3/14test: Fix broken fs_obj_fat fixturetest/py/tests/test_fs/conftest.py+1 -10 replies
4/14test: Convert test_cat to use FsHelpertest/py/tests/test_cat.py+7 -200 replies
5/14test: Convert test_xxd to use FsHelpertest/py/tests/test_xxd.py+7 -210 replies
6/14test: Convert test_efi_bootmgr to use FsHelpertest/py/tests/test_efi_bootmgr.py+14 -240 replies
7/14test: Convert setup_bootmenu_image() to use FsHelpertest/py/tests/test_ut.py+9 -80 replies
8/14test: Split out core of Fedora image into a new functiontest/py/tests/test_ut.py+47 -240 replies
9/14test: Convert setup_bootflow_image() to use FsHelpertest/py/tests/test_ut.py+19 -140 replies
10/14test: Convert setup_efi_image() to use FsHelpertest/py/tests/test_ut.py+11 -120 replies
11/14test: Convert test_ut_dm_init() to use FsHelpertest/py/tests/test_ut.py+2 -20 replies
12/14test: Rename setup_bootflow_image()test/py/tests/test_ut.py+2 -20 replies
13/14test: Convert setup_rauc_image() to use FsHelpertest/py/tests/test_ut.py+18 -320 replies
14/14test: Convert test_fs fixtures to use FsHelpertest/py/tests/test_fs/conftest.py+64 -1340 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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(-)
Signature · 4 lines
2.43.0

base-commit: 1c1bfb1cf34bbb2a5717eb6995c55093279f9341
branch: testfsa