mbox series

[net-next,v2,0/6] selftests: drv-net: support testing with a remote system

Message ID 20240416004556.1618804-1-kuba@kernel.org (mailing list archive)
Headers show
Series selftests: drv-net: support testing with a remote system | expand

Message

Jakub Kicinski April 16, 2024, 12:45 a.m. UTC
Hi!

Implement support for tests which require access to a remote system /
endpoint which can generate traffic.
This series concludes the "groundwork" for upstream driver tests.

I wanted to support the three models which came up in discussions:
 - SW testing with netdevsim
 - "local" testing with two ports on the same system in a loopback
 - "remote" testing via SSH
so there is a tiny bit of an abstraction which wraps up how "remote"
commands are executed. Otherwise hopefully there's nothing surprising.

I'm only adding a ping test. I had a bigger one written but I was
worried we'll get into discussing the details of the test itself
and how I chose to hack up netdevsim, instead of the test infra...
So that test will be a follow up :)

v2:
 - rename endpoint -> remote
 - use 2001:db8:: v6 prefix
 - add a note about persistent SSH connections
 - add the kernel config
v1: https://lore.kernel.org/all/20240412233705.1066444-1-kuba@kernel.org

Jakub Kicinski (6):
  selftests: drv-net: add stdout to the command failed exception
  selftests: drv-net: add config for netdevsim
  selftests: drv-net: define endpoint structures
  selftests: drv-net: factor out parsing of the env
  selftests: drv-net: construct environment for running tests which
    require an endpoint
  selftests: drv-net: add a trivial ping test

 tools/testing/selftests/drivers/net/Makefile  |   5 +-
 .../testing/selftests/drivers/net/README.rst  |  33 ++++
 tools/testing/selftests/drivers/net/config    |   2 +
 .../selftests/drivers/net/lib/py/__init__.py  |   1 +
 .../selftests/drivers/net/lib/py/env.py       | 141 +++++++++++++++---
 .../selftests/drivers/net/lib/py/remote.py    |  13 ++
 .../drivers/net/lib/py/remote_netns.py        |  15 ++
 .../drivers/net/lib/py/remote_ssh.py          |  34 +++++
 tools/testing/selftests/drivers/net/ping.py   |  32 ++++
 .../testing/selftests/net/lib/py/__init__.py  |   1 +
 tools/testing/selftests/net/lib/py/netns.py   |  31 ++++
 tools/testing/selftests/net/lib/py/utils.py   |  22 +--
 12 files changed, 301 insertions(+), 29 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/config
 create mode 100644 tools/testing/selftests/drivers/net/lib/py/remote.py
 create mode 100644 tools/testing/selftests/drivers/net/lib/py/remote_netns.py
 create mode 100644 tools/testing/selftests/drivers/net/lib/py/remote_ssh.py
 create mode 100755 tools/testing/selftests/drivers/net/ping.py
 create mode 100644 tools/testing/selftests/net/lib/py/netns.py

Comments

Willem de Bruijn April 16, 2024, 3:07 p.m. UTC | #1
Jakub Kicinski wrote:
> Hi!
> 
> Implement support for tests which require access to a remote system /
> endpoint which can generate traffic.
> This series concludes the "groundwork" for upstream driver tests.
> 
> I wanted to support the three models which came up in discussions:
>  - SW testing with netdevsim
>  - "local" testing with two ports on the same system in a loopback
>  - "remote" testing via SSH
> so there is a tiny bit of an abstraction which wraps up how "remote"
> commands are executed. Otherwise hopefully there's nothing surprising.
> 
> I'm only adding a ping test. I had a bigger one written but I was
> worried we'll get into discussing the details of the test itself
> and how I chose to hack up netdevsim, instead of the test infra...
> So that test will be a follow up :)
> 
> v2:
>  - rename endpoint -> remote
>  - use 2001:db8:: v6 prefix
>  - add a note about persistent SSH connections
>  - add the kernel config
> v1: https://lore.kernel.org/all/20240412233705.1066444-1-kuba@kernel.org
> 
> Jakub Kicinski (6):
>   selftests: drv-net: add stdout to the command failed exception
>   selftests: drv-net: add config for netdevsim
>   selftests: drv-net: define endpoint structures
>   selftests: drv-net: factor out parsing of the env
>   selftests: drv-net: construct environment for running tests which
>     require an endpoint
>   selftests: drv-net: add a trivial ping test

Reviewed-by: Willem de Bruijn <willemb@google.com>

Thanks for humoring the naming suggestions. Exciting to have this infra.
Jakub Kicinski April 16, 2024, 11:58 p.m. UTC | #2
On Tue, 16 Apr 2024 11:07:08 -0400 Willem de Bruijn wrote:
> Thanks for humoring the naming suggestions. Exciting to have this infra.

I wrote a couple more tests today and as you predicted already needed
wait_port_listen()...  I also discovered a few sharp edges with the
way the commands are wrapped for the remote host. I'll apply the first
two patches for now, and repost the rest tomorrow/Thu once I gain more
confidence.
patchwork-bot+netdevbpf@kernel.org April 17, 2024, 2 a.m. UTC | #3
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 15 Apr 2024 17:45:50 -0700 you wrote:
> Hi!
> 
> Implement support for tests which require access to a remote system /
> endpoint which can generate traffic.
> This series concludes the "groundwork" for upstream driver tests.
> 
> I wanted to support the three models which came up in discussions:
>  - SW testing with netdevsim
>  - "local" testing with two ports on the same system in a loopback
>  - "remote" testing via SSH
> so there is a tiny bit of an abstraction which wraps up how "remote"
> commands are executed. Otherwise hopefully there's nothing surprising.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/6] selftests: drv-net: add stdout to the command failed exception
    https://git.kernel.org/netdev/net-next/c/232d79aaa781
  - [net-next,v2,2/6] selftests: drv-net: add config for netdevsim
    https://git.kernel.org/netdev/net-next/c/438ce84bae90
  - [net-next,v2,3/6] selftests: drv-net: define endpoint structures
    (no matching commit)
  - [net-next,v2,4/6] selftests: drv-net: factor out parsing of the env
    (no matching commit)
  - [net-next,v2,5/6] selftests: drv-net: construct environment for running tests which require an endpoint
    (no matching commit)
  - [net-next,v2,6/6] selftests: drv-net: add a trivial ping test
    (no matching commit)

You are awesome, thank you!