public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Alessandro <alessandro@0x65c.net>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, skhan@linuxfoundation.org,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] selftests: rtnetlink: add checks for ifconfig and iproute2
Date: Thu, 21 Aug 2025 08:58:53 +0000	[thread overview]
Message-ID: <aKbfzeS1QrP0dE4N@fedora> (raw)
In-Reply-To: <CAKiXHKcLsEWbEz1EkzE942PbsMEpfj=wO7uYDb+Nxy8nGCEx1Q@mail.gmail.com>

On Thu, Aug 21, 2025 at 10:45:19AM +0200, Alessandro wrote:
> On Thu, 21 Aug 2025 at 10:25, Hangbin Liu <liuhangbin@gmail.com> wrote:
> >
> > 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@0x65c.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?
> >
> 
> Thank you for your review and comment.
> 
> My takeaway here is that the test works because the IP addresses are set on the
> $devdummy by the previous ip(8) command, and ifconfig seems a bit redundant.

No, please check the git log to see why we use ifconfig here.

Thanks
Hangbin

> 
> Also, considering we are testing netlink, I was baffled to see ifconfig there
> that, if I'm not mistaken, uses ioctl(); but I might be missing
> something obvious
> here, considering I'm looking at these tests for the first time, so bear with
> me :)
> 
> If it's better to skip the test altogether when ifconfig is missing, I'll
> submit another patch to do so.
> 
> Thank you
> 
> Best regards,
> Alessandro

  reply	other threads:[~2025-08-21  8:59 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 [this message]
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
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=aKbfzeS1QrP0dE4N@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox