[PATCH v2] test: boot: Add test for bootmeth_rauc
    Martin Schwan 
    M.Schwan at phytec.de
       
    Tue Oct 14 10:31:12 CEST 2025
    
    
  
Hi Tom,
On Mon, 2025-10-13 at 15:08 -0600, Tom Rini wrote:
> 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 <m.schwan at phytec.de>
> > ---
> > 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/20251008-wip-bootmeth-rauc-tests-v1-1-3da21a731524@phytec.de
> > ---
> >  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 ------------------
> -----------
That's strange. I cannot reproduce this error on my local machine
(Archlinux), neither with Python 3.13 nor 3.10. Do you have additional
output of the process call? Or is the captured stdout empty? Maybe
there is something in stderr? The exit code 1 seems rather generic. At
least I see all the required files on my machine for that call.
Regards,
Martin
    
    
More information about the U-Boot
mailing list