[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aKbX_CzxSi7T9Bcp@fedora>
Date: Thu, 21 Aug 2025 08:25:32 +0000
From: Hangbin Liu <liuhangbin@...il.com>
To: Alessandro Ratti <alessandro@...5c.net>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, skhan@...uxfoundation.org,
netdev@...r.kernel.org, linux-kselftest@...r.kernel.org,
alessandro.ratti@...il.com
Subject: Re: [PATCH] selftests: rtnetlink: add checks for ifconfig and
iproute2
On Thu, Aug 21, 2025 at 09:43:11AM +0200, Alessandro Ratti wrote:
> On systems where `ifconfig` is not available (e.g., modern Debian), the
> `kci_test_promote_secondaries` test fails. Wrap the call in a check.
>
> Additionally, `do_test_address_proto` fails on iproute2 versions that
> lack support for `proto` in `ip address` commands. Add a minimal feature
> check and skip the test with a proper message if unsupported.
>
> These changes allow the tests to run and report SKIP instead of FAIL on
> platforms with older tools.
>
> Signed-off-by: Alessandro Ratti <alessandro@...5c.net>
> ---
> tools/testing/selftests/net/rtnetlink.sh | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> index d6c00efeb664..9bff620ef595 100755
> --- a/tools/testing/selftests/net/rtnetlink.sh
> +++ b/tools/testing/selftests/net/rtnetlink.sh
> @@ -330,7 +330,9 @@ kci_test_promote_secondaries()
> for i in $(seq 2 254);do
> IP="10.23.11.$i"
> ip -f inet addr add $IP/16 brd + dev "$devdummy"
> - ifconfig "$devdummy" $IP netmask 255.255.0.0
> + if command -v ifconfig >/dev/null 2>&1; then
> + ifconfig "$devdummy" $IP netmask 255.255.0.0
> + fi
Maybe just skip the promote_secondaries test if ifconfig is not available?
Hangbin
> done
>
> ip addr flush dev "$devdummy"
> @@ -1201,6 +1203,12 @@ do_test_address_proto()
> local ret=0
> local err
>
> + run_cmd_grep 'proto' ip address help
> + if [ $? -ne 0 ];then
> + end_test "SKIP: addr proto ${what}: iproute2 too old"
> + return $ksft_skip
> + fi
> +
> ip address add dev "$devdummy" "$addr3"
> check_err $?
> proto=$(address_get_proto "$addr3")
> --
> 2.39.5
>
Powered by blists - more mailing lists