[LTP] [PATCH v2 2/4] lib/tst_test.sh: add TST_NEEDS_DRIVERS parameter

Alexey Kodanev alexey.kodanev@oracle.com
Fri Sep 14 13:54:00 CEST 2018


On 09/13/2018 03:35 PM, Cyril Hrubis wrote:
> Hi!
>> +tst_test_drivers()
>> +{
>> +	[ $# -eq 0 ] && return 0
>> +
>> +	local drv="$(tst_check_drivers $@ 2>&1)"
> 
> Wouldn't it be easier to just redirect the stderr into /dev/null here
> and check the $? instead of [ -n "$drv" ] ?
> 

It's better to print the error message if any, including the driver name that
is missing. And checking $? should work here too, will change that.


More information about the ltp mailing list