Re: [PATCH net-next v4 02/10] selftests: net: add helpers for running a command on other targets

Jakub Kicinski
2026-03-31T00:04:40Z

On Mon, 30 Mar 2026 13:02:12 +0200 Petr Machata wrote:
> > +run_on()
> > +{
> > + local iface=$1; shift
> > + local target="local:"
> > +
> > + if declare -p TARGETS &>/dev/null; then
> > + target="${TARGETS[$iface]}"
>
> So I think Jakub's runs fail because there's a shell export somewhere
> that gets inherited through make to the launched test. I guess it would
> be enough for the test to validate that TARGETS is an array, because
> those don't get inherited.

Great catch, FWIW. Yes TARGETS is what ksft makefiles use to define
the group of tests. We do

make ... TARGETS=drivers/net ... run_tests