Subject: Re: [PATCH net] kselftest: rtnetlink.sh: use grep_fail when expecting the cmd fail

From: Simon Horman <[email-masked]>
Date: Wed, 20 Dec 2023 15:06:40 +0100

On Tue, Dec 19, 2023 at 02:57:37PM +0800, Hangbin Liu wrote:
> run_cmd_grep_fail should be used when expecting the cmd fail, or the ret
> will be set to 1, and the total test return 1 when exiting. This would cause
> the result report to fail if run via run_kselftest.sh.
> 
> Before fix:
>  # ./rtnetlink.sh -t kci_test_addrlft
>  PASS: preferred_lft addresses have expired
>  # echo $?
>  1
> 
> After fix:
>  # ./rtnetlink.sh -t kci_test_addrlft
>  PASS: preferred_lft addresses have expired
>  # echo $?
>  0
> 
> Fixes: 9c2a19f71515 ("kselftest: rtnetlink.sh: add verbose flag")
> Signed-off-by: Hangbin Liu <[email-masked]>

Thanks,

I agree that this corrects inverted logic wrt setting
the global 'ret' value and in turn the exit value of the script.

I also agree that the problem was introduced by the cited commit.

Reviewed-by: Simon Horman <[email-masked]>