Re: [PATCH net-next v2 2/4] netconsole: selftest: Split the helpers from the selftest
From: Breno Leitao
Date: Wed Jan 08 2025 - 06:19:50 EST
On Mon, Jan 06, 2025 at 04:06:53PM -0800, Jakub Kicinski wrote:
> On Fri, 03 Jan 2025 04:57:50 -0800 Breno Leitao wrote:
> > Split helper functions from the netconsole basic test into a separate
> > library file to enable reuse across different netconsole tests. This
> > change only moves the existing helper functions to lib/sh/lib_netcons.sh
> > while preserving the same test functionality.
> >
> > The helpers provide common functions for:
> > - Setting up network namespaces and interfaces
> > - Managing netconsole dynamic targets
> > - Setting user data
> > - Handling test dependencies
> > - Cleanup operations
> >
> > Do not make any change in the code, other than the mechanical
> > separation.
>
> You have to update the Makefile, we don't wildcard all files under
> drivers/net/lib, the lib support in ksft is not great :(
>
> $ make -C tools/testing/selftests/ \
> TARGETS="drivers/net drivers/net/hw" \
> install INSTALL_PATH=/tmp/ksft-net-drv
> [... noise ...]
> $ find /tmp/ksft-net-drv/ -iname '*netcons*'
> /tmp/ksft-net-drv/drivers/net/netcons_basic.sh
> /tmp/ksft-net-drv/drivers/net/netcons_overflow.sh
>
> .. your new lib file won't get installed.
Thanks for the detailed explanation. I found that the new lib was not
installed.
I will be adding the following to the upcoming revision.
/tools/testing/selftests/drivers/net/Makefile
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
TEST_INCLUDES := $(wildcard lib/py/*.py) \
+ $(wildcard lib/sh/*.sh) \
../../net/net_helper.sh \
../../net/lib.sh \