On Thu, Oct 09, 2025 at 09:06:12AM +0200, Martin Schwan wrote: > Add a simple unit test for testing the RAUC bootmethod. Provide only the > very basic tests for now, running a scan and list, to verify correct > detection of the RAUC bootmethod. More advanced boot tests of this > bootmethod can be added in a separate patch. > > This requires another mmc image (mmc9) to contain the following > partitions: > > 1. boot A: contains a dummy boot.scr > 2. root A: contains an empty root filesystem > 3. boot B: contains a dummy boot.scr > 4. root B: contains an empty root filesystem > > The bootmeth_rauc scans all four partitions for existence and expects a > boot script in each boot partition. > > Also add BOOTMETH_RAUC as a dependency on sandbox so that we can test > this with: > > $ ./test/py/test.py -B sandbox --build -k test_ut # build the mmc9.img > $ ./test/py/test.py -B sandbox --build -k bootflow_rauc > > Signed-off-by: Martin Schwan <[email protected]> > --- > Changes in v2: > - Use mk_fs() instead of calling fallocate/mkfs/mcopy individually for > the boot and root partitions in mmc9.img > - Link to v1: > https://lore.kernel.org/r/[email protected] > --- > arch/sandbox/dts/test.dts | 8 +++++++ > configs/sandbox_defconfig | 1 + > test/boot/bootflow.c | 57 > +++++++++++++++++++++++++++++++++++++++++++++++ > test/py/tests/test_ut.py | 44 ++++++++++++++++++++++++++++++++++++ > 4 files changed, 110 insertions(+)
This doesn't work now:
=================================== FAILURES ===================================
___________________________ test_ut_dm_init_bootstd ____________________________
test/py/tests/test_ut.py:604: in test_ut_dm_init_bootstd
setup_rauc_image(ubman)
test/py/tests/test_ut.py:581: in setup_rauc_image
fs_helper.mk_fs(ubman.config, fs, 0x800000, fsfile.split('.')[0], bootdir)
test/py/tests/fs_helper.py:68: in mk_fs
check_call(f'mcopy -i {fs_img} -vsmpQ {src_dir}/* ::/', shell=True)
/usr/lib/python3.10/subprocess.py:369: in check_call
raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command 'mcopy -i
/tmp/sandbox/persistent-data/rauc_boot.fat32.img -vsmpQ
/tmp/sandbox/persistent-data/boot/* ::/' returned non-zero exit status 1.
----------------------------- Captured stdout call -----------------------------
--
Tom
signature.asc
Description: PGP signature

