[PATCH v2 2/2] test: cmd: Add test for zip/unzip/gzwrite commands

Marek Vasut marek.vasut at mailbox.org
Thu Feb 5 00:44:36 CET 2026


On 2/3/26 10:31 PM, Simon Glass wrote:

Hello Simon,

>> +       ut_assertok(run_command("random $loadaddr $size", 0));
>> +       ut_assert_nextline("%d bytes filled with random data", size);
>> +       ut_assertok(run_command("random $encaddr $size", 0));
>> +       ut_assert_nextline("%d bytes filled with random data", size);
>> +       ut_assertok(run_command("random $decaddr $size", 0));
>> +       ut_assert_nextline("%d bytes filled with random data", size);
> 
> I would argue for calling the functions directly instead of via run_command()

It seems I cannot include sys/random.h in this test to get access to 
getrandom() function , do you have any suggestion here ?

>> +
>> +       /* Compress data in $loadaddr into $encaddr */
>> +       ut_assertok(run_command("zip $loadaddr $size $encaddr", 0));
> 
> Perhaps add a flag to avoid generating so much output from this command?

It is the gzwrite command which generates a lot of output, not the zip 
command. And the excess output from gzwrite command is solved in this v2 
without any need for special flags to gzwrite like in V1 of this patchset.

[...]


More information about the U-Boot mailing list