mbox series

[RFC,net-next,00/10] selftests: Add TEST_INCLUDES directive and adjust tests to use it

Message ID 20231222135836.992841-1-bpoirier@nvidia.com (mailing list archive)
Headers show
Series selftests: Add TEST_INCLUDES directive and adjust tests to use it | expand

Message

Benjamin Poirier Dec. 22, 2023, 1:58 p.m. UTC
From: Benjamin Poirier <benjamin.poirier@gmail.com>

After commit 25ae948b4478 ("selftests/net: add lib.sh"), some net
selftests encounter errors when they are being exported and run. This is
because the new net/lib.sh is not exported along with the tests.

After some related fixes to net selftests, this series introduces a new
selftests Makefile variable to list extra files to export from other
directories and makes use of it to resolve the errors described above.

Link: https://lore.kernel.org/netdev/ZXu7dGj7F9Ng8iIX@Laptop-X1/

Benjamin Poirier (9):
  selftests: bonding: Change script interpreter
  selftests: forwarding: Remove executable bits from lib.sh
  selftests: forwarding: Simplify forwarding.config import logic
  selftests: Introduce Makefile variable to list shared bash scripts
  selftests: forwarding: Add net/lib.sh to TEST_INCLUDES
  selftests: bonding: Add lib.sh scripts to TEST_INCLUDES
  selftests: team: Add lib.sh scripts to TEST_INCLUDES
  selftests: team: Add shared library script to TEST_INCLUDES
  selftests: dsa: Replace symlinks by wrapper script

Petr Machata (1):
  selftests: forwarding: Import top-level lib.sh through absolute path

 Documentation/dev-tools/kselftest.rst          |  6 ++++++
 tools/testing/selftests/Makefile               |  7 ++++++-
 .../selftests/drivers/net/bonding/Makefile     |  7 +++++--
 .../net/bonding/bond-eth-type-change.sh        |  2 +-
 .../drivers/net/bonding/bond_topo_2d1c.sh      |  2 +-
 .../drivers/net/bonding/dev_addr_lists.sh      |  2 +-
 .../net/bonding/mode-1-recovery-updelay.sh     |  4 ++--
 .../net/bonding/mode-2-recovery-updelay.sh     |  4 ++--
 .../drivers/net/bonding/net_forwarding_lib.sh  |  1 -
 .../testing/selftests/drivers/net/dsa/Makefile | 18 ++++++++++++++++--
 .../drivers/net/dsa/bridge_locked_port.sh      |  2 +-
 .../selftests/drivers/net/dsa/bridge_mdb.sh    |  2 +-
 .../selftests/drivers/net/dsa/bridge_mld.sh    |  2 +-
 .../drivers/net/dsa/bridge_vlan_aware.sh       |  2 +-
 .../drivers/net/dsa/bridge_vlan_mcast.sh       |  2 +-
 .../drivers/net/dsa/bridge_vlan_unaware.sh     |  2 +-
 tools/testing/selftests/drivers/net/dsa/lib.sh |  1 -
 .../drivers/net/dsa/local_termination.sh       |  2 +-
 .../selftests/drivers/net/dsa/no_forwarding.sh |  2 +-
 .../drivers/net/dsa/run_net_forwarding_test.sh |  9 +++++++++
 .../selftests/drivers/net/dsa/tc_actions.sh    |  2 +-
 .../selftests/drivers/net/dsa/tc_common.sh     |  1 -
 .../drivers/net/dsa/test_bridge_fdb_stress.sh  |  2 +-
 .../selftests/drivers/net/team/Makefile        |  7 ++++---
 .../drivers/net/team/dev_addr_lists.sh         |  4 ++--
 .../selftests/drivers/net/team/lag_lib.sh      |  1 -
 .../drivers/net/team/net_forwarding_lib.sh     |  1 -
 tools/testing/selftests/lib.mk                 |  6 ++++++
 .../testing/selftests/net/forwarding/Makefile  |  3 +++
 tools/testing/selftests/net/forwarding/lib.sh  | 12 +++++-------
 30 files changed, 79 insertions(+), 39 deletions(-)
 delete mode 120000 tools/testing/selftests/drivers/net/bonding/net_forwarding_lib.sh
 delete mode 120000 tools/testing/selftests/drivers/net/dsa/lib.sh
 create mode 100755 tools/testing/selftests/drivers/net/dsa/run_net_forwarding_test.sh
 delete mode 120000 tools/testing/selftests/drivers/net/dsa/tc_common.sh
 delete mode 120000 tools/testing/selftests/drivers/net/team/lag_lib.sh
 delete mode 120000 tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh
 mode change 100755 => 100644 tools/testing/selftests/net/forwarding/lib.sh

Comments

Hangbin Liu Dec. 23, 2023, 9:27 a.m. UTC | #1
On Fri, Dec 22, 2023 at 08:58:26AM -0500, Benjamin Poirier wrote:
> From: Benjamin Poirier <benjamin.poirier@gmail.com>
> 
> After commit 25ae948b4478 ("selftests/net: add lib.sh"), some net
> selftests encounter errors when they are being exported and run. This is
> because the new net/lib.sh is not exported along with the tests.
> 
> After some related fixes to net selftests, this series introduces a new
> selftests Makefile variable to list extra files to export from other
> directories and makes use of it to resolve the errors described above.
> 
> Link: https://lore.kernel.org/netdev/ZXu7dGj7F9Ng8iIX@Laptop-X1/

Tested with

make TARGETS="drivers/net/team drivers/net/bonding drivers/net/dsa" \
        -j8 -C tools/testing/selftests gen_tar

and all looks good to me. Thanks for your works!

Tested-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>