From: Hangbin Liu <hangbin.liu@linux.dev>
To: "Darío Hueso Gisbert" <darihueso21@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] selftests: rtnetlink: skip ifalias test if uuidgen is missing
Date: Fri, 9 Oct 2026 10:18:50 +0800 [thread overview]
Message-ID: <ashPChZWM1ZMRMjL@fedora> (raw)
In-Reply-To: <20261008183742.678-1-darihueso21@gmail.com>
Hi Darío,
On Thu, Oct 08, 2026 at 08:37:41PM +0200, Darío Hueso Gisbert wrote:
> kci_test_ifalias() uses uuidgen to generate the alias names, but
> uuidgen is not always installed on minimal systems. When it is
> missing, the test fails with "uuidgen: command not found" instead of
> being reported as skipped.
>
> Check for uuidgen before running the test and return SKIP when it is
> not available, as kci_test_promote_secondaries() already does for
> ifconfig.
>
> Assisted-by: LLM
> Signed-off-by: Darío Hueso Gisbert <darihueso21@gmail.com>
> ---
> The commit message and the added check were drafted with the help of
> an LLM (Claude). I reviewed both and tested the script on a kernel
> built from mainline, with uuidgen installed (unchanged behaviour) and
> with it removed (the ifalias test now reports SKIP instead of FAIL).
>
> On that kernel the unrelated ipsec_offload test fails with and without
> this change.
>
> tools/testing/selftests/net/rtnetlink.sh | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> index 4843d474538f..c758efb734da 100755
> --- a/tools/testing/selftests/net/rtnetlink.sh
> +++ b/tools/testing/selftests/net/rtnetlink.sh
> @@ -412,6 +412,13 @@ kci_test_addrlabel()
> kci_test_ifalias()
> {
> local ret=0
> +
> + run_cmd uuidgen
> + if [ $ret -ne 0 ]; then
> + end_test "SKIP: uuidgen not installed"
> + return $ksft_skip
> + fi
You can use check_command, which will log test and return correctly.
Thanks
Hangbin
> +
> namewant=$(uuidgen)
> syspathname="/sys/class/net/$devdummy/ifalias"
> run_cmd ip link set dev "$devdummy" alias "$namewant"
> --
> 2.53.0
>
prev parent reply other threads:[~2026-10-09 2:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 18:37 Darío Hueso Gisbert
2026-10-09 2:18 ` Hangbin Liu [this message]
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=ashPChZWM1ZMRMjL@fedora \
--to=hangbin.liu@linux.dev \
--cc=darihueso21@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®