Re: [PATCH net-next v4 00/10] selftests: drivers: bash support for remote traffic generators

From: Petr Machata

Date: Mon Mar 30 2026 - 08:03:20 EST



Ioana Ciornei <ioana.ciornei@xxxxxxx> writes:

> On Mon, Mar 30, 2026 at 12:38:54PM +0200, Petr Machata wrote:
>>
>> Jakub Kicinski <kuba@xxxxxxxxxx> writes:
>>
>> > On Fri, 27 Mar 2026 09:32:22 +0200 Ioana Ciornei wrote:
>> >> On Thu, Mar 26, 2026 at 12:03:42PM -0700, Jakub Kicinski wrote:
>> >> > On Thu, 26 Mar 2026 15:28:18 +0200 Ioana Ciornei wrote:
>> >> > > This patch set aims to add the necessary support so that bash written
>> >> > > selftests are also able to easily run with a remote traffic generator
>> >> > > system, either be it in another netns or one accessible through ssh.
>> >> > >
>> >> > > This patch set is a result of the discussion from v1:
>> >> > > https://lore.kernel.org/all/20260303084330.340b6459@xxxxxxxxxx/
>> >> > > Even though the python infrastructure is already established, some
>> >> > > things are easier in bash and it would be a shame to leave behind the
>> >> > > bash tests that we already have.
>> >> >
>> >> > I think this introduces a bunch of regressions, eg:
>> >> >
>> >> > https://netdev-ctrl.bots.linux.dev/logs/vmksft/forwarding/results/575622/4-local-termination-sh/stdout
>> >> >
>> >> > https://netdev-ctrl.bots.linux.dev/logs/vmksft/netdevsim/results/575802/18-netcons-resume-sh/stdout
>> >>
>> >> I cannot reproduce this unfortunately. For example, local_termination.sh
>> >> gives me the following result with the exact patches that I submitted.
>> >> Any idea on what might be the difference?
>> >
>> > Hm, the system that runs this on our end is:
>> >
>> > # cat /etc/redhat-release
>> > Fedora release 43 (Forty Three)
>> >
>> > And it has this added on top of default install:
>> >
>> > # cat /etc/systemd/network/99-default.link
>> > [Match]
>> > OriginalName=*
>> >
>> > [Link]
>> > NamePolicy=keep kernel database onboard slot path
>> > AlternativeNamesPolicy=database onboard slot path mac
>> > MACAddressPolicy=none
>>
>> The observed issues are consistent with TARGETS being defined, but not
>> an array:
>>
>> $ declare -A T
>> $ T=([a.100]=b)
>> $ U=foo
>> $ if declare -p T &>/dev/null; then echo "${T[a.100]}"; else echo fail; fi
>> b
>> $ if declare -p U &>/dev/null; then echo "${U[a.100]}"; else echo fail; fi
>> bash: a.100: syntax error: invalid arithmetic operator (error token is ".100")
>
> Totally agree, that's what it looks like.
>
> On the other hand, I don't see any other use of the TARGETS variable in
> tools/testing/selftests. The only way I can trigger that kind of error
> is by setting and exporting TARGETS before running the test.
>
> root@localhost:~/ksft-net-drv# export TARGETS=test
> root@localhost:~/ksft-net-drv# ./run_kselftest.sh -t drivers/net/netconsole:netcons_resume.sh
> [ 1895.134633] kselftest: Running tests in drivers/net/netconsole
> TAP version 13
> 1..1
> # timeout set to 45
> # selftests: drivers/net/netconsole: netcons_resume.sh
> # Running with bind mode: ifname
> # /root/ksft-net-drv/drivers/net/lib/sh/../../../../net/lib.sh: line 707: eni497np1: unbound variable
> not ok 1 selftests: drivers/net/netconsole: netcons_resume.sh # exit=1
>
> So this means that TARGETS is used by the netdev testing
> infrastructure, I presume.

I think Jakub has the export for make to pick up, and then tests inherit
it.

> Anyhow, I can change the variable name to avoid this. Something like
> NETIF_TARGETS?

I sent some thoughts about how to fix the issue in my review of 02/10,
so let's move the discussion there.