summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2026-04-04 08:03:11 -0600
committerTom Rini <[email protected]>2026-04-21 15:30:38 -0600
commit57e1788ee1362d9ad03e72e75026da5ae7d1b686 (patch)
tree8078f06484baf08220e07329a90a1d1f9384dabf /test
parent3dc999d17ef9b4c8873358d0761a03cc5d155281 (diff)
test: Convert setup_bootmenu_image() to use FsHelper
Simplify this test-setup code by using the helper. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_ut.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py
index 98641a46c1d..a1c4af1b096 100644
--- a/test/py/tests/test_ut.py
+++ b/test/py/tests/test_ut.py
@@ -17,6 +17,7 @@ import pytest
import utils
# pylint: disable=E0611
from tests import fs_helper
+from fs_helper import DiskHelper, FsHelper
from test_android import test_abootimg
def mkdir_cond(dirname):
@@ -45,7 +46,6 @@ def setup_bootmenu_image(ubman):
This is modelled on Armbian 22.08 Jammy
"""
mmc_dev = 4
- fname, mnt = fs_helper.setup_image(ubman, mmc_dev, 0x83)
script = '''# DO NOT EDIT THIS FILE
#
@@ -121,7 +121,9 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
'''
- bootdir = os.path.join(mnt, 'boot')
+ fsh = FsHelper(ubman.config, 'ext4', 18, 'mmc')
+ fsh.setup()
+ bootdir = os.path.join(fsh.srcdir, 'boot')
mkdir_cond(bootdir)
cmd_fname = os.path.join(bootdir, 'boot.cmd')
scr_fname = os.path.join(bootdir, 'boot.scr')
@@ -150,13 +152,12 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
utils.run_and_log(
ubman, f'echo here {kernel} {symlink}')
os.symlink(kernel, symlink)
+ fsh.mk_fs()
+ img = DiskHelper(ubman.config, mmc_dev, 'mmc', True)
+ img.add_fs(fsh, DiskHelper.EXT4)
+ img.create()
+ fsh.cleanup()
- fsfile = 'ext18M.img'
- utils.run_and_log(ubman, f'fallocate -l 18M {fsfile}')
- utils.run_and_log(ubman, f'mkfs.ext4 {fsfile} -d {mnt}')
- copy_partition(ubman, fsfile, fname)
- utils.run_and_log(ubman, f'rm -rf {mnt}')
- utils.run_and_log(ubman, f'rm -f {fsfile}')
def setup_bootflow_image(ubman):
"""Create a 20MB disk image with a single FAT partition"""