Re: [PATCH net-next v5 7/9] selftests: drivers: hw: move to KTAP output

Ioana Ciornei
2026-04-03T13:46:46Z

On Thu, Apr 02, 2026 at 12:10:09PM +0200, Paolo Abeni wrote:
> On 3/30/26 5:29 PM, Ioana Ciornei wrote:
> > diff --git a/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh b/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
> > index f290ce1832f1..ed81bdc33536 100755
> > --- a/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
> > +++ b/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
> > @@ -11,10 +11,12 @@ ALL_TESTS="
> > NUM_NETIFS=2
> > lib_dir=$(dirname "$0")
> > source "$lib_dir"/../../../net/forwarding/lib.sh
> > +source "$lib_dir"/../../../kselftest/ktap_helpers.sh
>
> AI review noted:
> ---
> Will this test work correctly after installation? The test sources
> ktap_helpers.sh but the file doesn't appear to be included in the
> Makefile's TEST_INCLUDES variable.
>
> Looking at tools/testing/selftests/drivers/net/hw/Makefile, when
> 'make install' is run, only files listed in TEST_PROGS, TEST_FILES,
> and TEST_INCLUDES are copied to the installation directory. Files
> referenced via 'source' need to be in TEST_INCLUDES to be available
> at runtime.
>
> Without adding '../../../kselftest/ktap_helpers.sh' to TEST_INCLUDES,
> the test will fail with 'No such file or directory' when run from an
> installed location.

Now that I actually looked at this, I don't think that adding
ktap_helpers.sh in TEST_INCLUDES is actually needed.

tools/testing/selftests/Makefile installs ktap_helpers.sh irrespective
of it being included in any TEST_INCLUDES.

install: all
ifdef INSTALL_PATH
@# Ask all targets to install their files
mkdir -p $(INSTALL_PATH)/kselftest
install -m 744 kselftest/module.sh $(INSTALL_PATH)/kselftest/
install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
install -m 744 kselftest/ktap_helpers.sh $(INSTALL_PATH)/kselftest/

I tested this and even if I only install drivers/net/hw I still get
ktap_helpers.sh in the install path.

Ioana