[PATCH v11 06/29] test: boot: fix bootflow_cmd_label for when DSA_SANDBOX is disabled
Jerome Forissier
jerome.forissier at linaro.org
Fri Oct 4 10:46:18 CEST 2024
On 10/4/24 08:55, Ilias Apalodimas wrote:
> Hi Jerome,
>
> On Thu, 3 Oct 2024 at 18:23, Jerome Forissier
> <jerome.forissier at linaro.org> wrote:
>>
>> When DSA_SANDBOX is not set, the sandbox tests fail as follows:
>>
>> $ ./test/py/test.py --build-dir=$(pwd) -k bootdev_test_any
>> [...]
>> Scanning for bootflows with label '9'
>> [...]
>> Cannot find '9' (err=-19)
>>
>> This is due to the device list containing two less entries than
>> expected. Therefore, look for label '7' when DSA_SANDBOX is disabled.
>>
>> The actual use case is NET_LWIP=y (to be introduced in later patches)
>> which implies DSA_SANDBOX=n for the time being.
>>
>> Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
>> ---
>> test/boot/bootflow.c | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
>> index 6ad63afe90a..c440b8eb778 100644
>> --- a/test/boot/bootflow.c
>> +++ b/test/boot/bootflow.c
>> @@ -109,9 +109,12 @@ static int bootflow_cmd_label(struct unit_test_state *uts)
>> * 8 [ ] OK mmc mmc2.bootdev
>> * 9 [ + ] OK mmc mmc1.bootdev
>> * a [ ] OK mmc mmc0.bootdev
>> + *
>> + * However with CONFIG_DSA_SANDBOX=n we have two less (dsa-test at 0 and
>> + * dsa-test at 1).
>> */
>> - ut_assertok(run_command("bootflow scan -lH 9", 0));
>> - ut_assert_nextline("Scanning for bootflows with label '9'");
>
> Shouldn't this under and #ifdef, IS_ENABLED etc?
In theory yes, but we can avoid the conditional by using index 7 which is always
valid, i.e., in all configurations we have at least 7 devices (even 8 actually).
>
>> + ut_assertok(run_command("bootflow scan -lH 7", 0));
>> + ut_assert_nextline("Scanning for bootflows with label '7'");
>> ut_assert_skip_to_line("(1 bootflow, 1 valid)");
>>
>> ut_assertok(run_command("bootflow scan -lH 0", 0));
>> --
>> 2.40.1
>>
More information about the U-Boot
mailing list