Re: [PATCH net] selftests: fib_tests: use per-test return value in subtests
From: Ido Schimmel
Date: Tue Sep 29 2026 - 09:48:25 EST
On Tue, Sep 29, 2026 at 09:57:01AM +0800, Hangbin Liu wrote:
> From: Hangbin Liu <liuhangbin@xxxxxxxxxx>
>
> fib_tests mixes use of $ret for both per-test return value and global exit
> code. If an earlier subtest fails and a later function sets ret=0, the
> script will exit with status 0 even though [FAIL] lines were printed.
>
> Use RET as the per-test return value, as already defined in lib.sh. The
> exit code ret will only be set in log_test().
>
> Fixes: 607bd2e502f5 ("selftests: fib_tests: Add test cases for IPv4/IPv6 FIB")
> Reported-by: Sashiko <netdev-bot+sashiko@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/178961184152.22033.9267194009793243294@xxxxxxxxxx
> Signed-off-by: Hangbin Liu <liuhangbin@xxxxxxxxxx>
Please target the patch at net-next and drop the Fixes tag. The patch
doesn't fix a regression, nothing is failing (or passing when it
shouldn't) because of it and it cannot be backported cleanly to old
kernels anyway. I targeted similar patches at net-next in the past. See
[1], for example.
[1] https://lore.kernel.org/all/20250908073238.119240-5-idosch@xxxxxxxxxx/
> ---
> tools/testing/selftests/net/fib_tests.sh | 40 ++++++++++++++++----------------
> 1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
> index b338bfb196a2..9ce5623b049c 100755
> --- a/tools/testing/selftests/net/fib_tests.sh
> +++ b/tools/testing/selftests/net/fib_tests.sh
> @@ -369,7 +369,7 @@ fib_carrier_local_test()
>
> fib_carrier_unicast_test()
> {
> - ret=0
> + RET=0
Looks like this line can be removed (similar to fib_carrier_local_test()
above it) given that RET is never used in this function
>
> echo
> echo "Single path route carrier test"