From: Hangbin Liu <liuhangbin@gmail.com>
To: Alessandro Ratti <alessandro@0x65c.net>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, skhan@linuxfoundation.org
Subject: Re: [PATCH net-next v2] selftests: rtnetlink: skip tests if tools or feats are missing
Date: Fri, 22 Aug 2025 13:03:22 +0000 [thread overview]
Message-ID: <aKhqmsheZAqThrSu@fedora> (raw)
In-Reply-To: <20250822121456.874759-2-alessandro@0x65c.net>
On Fri, Aug 22, 2025 at 02:08:42PM +0200, Alessandro Ratti wrote:
> Some rtnetlink selftests assume the presence of ifconfig and iproute2
> support for the `proto` keyword in `ip address` commands. These
> assumptions can cause test failures on modern systems (e.g. Debian
> Bookworm) where:
>
> - ifconfig is not installed by default
> - The iproute2 version lacks support for address protocol
>
> This patch improves test robustness by:
>
> - Skipping kci_test_promote_secondaries if ifconfig is missing
> - Skipping do_test_address_proto if ip address help does not mention
> proto
>
> These changes ensure the tests degrade gracefully by reporting SKIP
> instead of FAIL when prerequisites are not met, improving portability
> across systems.
>
The Reviewed-by tag should be here
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
> Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>
>
> ---
> v2:
> - Updated the patch based on review from Hangbin Liu
> - Changed subject and commit message to better reflect updated behavior
> - Added Reviewed-by tag
>
> Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> tools/testing/selftests/net/rtnetlink.sh | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> index d6c00efeb664..c2a0e7f37391 100755
> --- a/tools/testing/selftests/net/rtnetlink.sh
> +++ b/tools/testing/selftests/net/rtnetlink.sh
> @@ -323,6 +323,11 @@ kci_test_addrlft()
>
> kci_test_promote_secondaries()
> {
> + run_cmd ifconfig "$devdummy"
> + if [ $ret -ne 0 ]; then
> + end_test "SKIP: ifconfig not installed"
> + return $ksft_skip
> + fi
> promote=$(sysctl -n net.ipv4.conf.$devdummy.promote_secondaries)
>
> sysctl -q net.ipv4.conf.$devdummy.promote_secondaries=1
> @@ -1201,6 +1206,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
>
next prev parent reply other threads:[~2025-08-22 13:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 7:43 [PATCH] selftests: rtnetlink: add checks for ifconfig and iproute2 Alessandro Ratti
2025-08-21 7:43 ` Alessandro Ratti
2025-08-21 8:25 ` Hangbin Liu
2025-08-21 8:45 ` Alessandro
2025-08-21 8:58 ` Hangbin Liu
2025-08-21 9:43 ` Alessandro Ratti
2025-08-21 14:16 ` [PATCH v2] selftests: rtnetlink: skip tests if tools or feats are missing Alessandro Ratti
2025-08-21 14:16 ` [PATCH] " Alessandro Ratti
2025-08-22 1:09 ` Hangbin Liu
2025-08-22 12:08 ` [PATCH net-next v2] " Alessandro Ratti
2025-08-22 12:08 ` Alessandro Ratti
2025-08-22 13:03 ` Hangbin Liu [this message]
2025-08-22 14:03 ` [PATCH net-next v3] " Alessandro Ratti
2025-08-22 14:03 ` Alessandro Ratti
2025-08-25 23:10 ` patchwork-bot+netdevbpf
2025-08-22 14:27 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aKhqmsheZAqThrSu@fedora \
--to=liuhangbin@gmail.com \
--cc=alessandro@0x65c.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.