On 31.10.26 15:06, Simon Glass wrote:
> Hi Frieder,
> 
> On 2026-10-29T16:23:07+11:00, Frieder Schrempf <[email protected]> wrote:
>> test: boot: Test the RAUC partition name check
>>
>> Set CONFIG_BOOTMETH_RAUC_PART_NAMES on sandbox and give the
>> partitions of the RAUC test image (mmc10) matching names. As only GPT
>> has partition names, DiskHelper now creates the image with GPT instead
>> of MBR. The existing test passes with or without the option, as the
>> names match.
>>
>> Add a second image (mmc13) with the same layout but other names, and
>> a test that the RAUC bootmeth finds no bootflow on it. The test is
>> skipped if the option is empty. It needs an #ifdef, since the string
>> option does not exist without BOOTMETH_RAUC and IS_ENABLED() cannot
>> check a string.
>>
>> Assisted-by: LLM
>> Signed-off-by: Frieder Schrempf <[email protected]>
>>
>>  arch/sandbox/dts/test.dts |  8 ++++++++
>>  configs/sandbox_defconfig |  1 +
>>  test/boot/bootflow.c      | 27 +++++++++++++++++++++++++++
>>  test/py/tests/test_ut.py  | 26 +++++++++++++++++---------
>>  4 files changed, 53 insertions(+), 9 deletions(-)
> 
>> diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
>> @@ -1824,6 +1824,33 @@ static int bootflow_bls_prefix(struct unit_test_state 
>> *uts)
>> +static int bootflow_rauc_part_names_check(struct unit_test_state *uts)
>> +{
>> +    ut_assertok(run_command("bootflow scan", 0));
>> +    ut_assert_nextline("No bootflows found; try again with -l");
>> +    ut_assert_console_end();
> 
> 'No bootflows found' doesn't tell us much here. The test also passes
> if mmc13.img is missing or empty (e.g. 'ut bootstd' run without
> test_ut_dm_init_bootstd first), or if BOOT_ORDER still holds an
> unknown slot: bootflow_rauc_check() leaves "A B rescue" in place if it
> fails partway through, and get_slot() then fails the same way. Please
> can you set BOOT_ORDER at the start and check that mmc13 really has
> the expected layout, e.g. by asserting the partition names with
> part_get_info() or 'part list mmc 13'? Then the only thing that can
> make the scan fail is the name check.

V2 will clear the variables for each scan and then check if they are
still unset afterwards. I will also do a positive scan first before each
negative scan. This will make sure that the partition layout is actually
correct without adding a separate check.

> 
> It would also be worth checking the environment after the scan: clear
> the variables first and assert afterwards that env_get() returns NULL
> for them. This would show the env_set() problem I mentioned on patch
> 6.

Yes, I will handle this in v2.

> 
>> diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
>> @@ -1824,6 +1824,33 @@ static int bootflow_bls_prefix(struct unit_test_state 
>> *uts)
>> +/* Test that the RAUC bootmeth ignores a device with other partition names 
>> */
>> +static int bootflow_rauc_part_names(struct unit_test_state *uts)
> 
> Please can you put this next to bootflow_rauc(), rather than after the
> BLS tests, so the RAUC tests stay together?
Sure.

Reply via email to