Skip to content

selftests: drv-net: support testing with a remote system

Jakub Kicinski linux-kselftest netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest7 patches 7 repliesApplied 7/7
  2. v47 patches 1 replySuperseded
  3. v38 patches 5 repliesSuperseded 2 of 8 applied
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v26 patches2 repliesSuperseded 2 of 6 applied
v15 patches17 repliesSuperseded

Changes in v5 from the cover letter · 20 lines

- fix rand port generation, and wrap it in a helper in case the random thing proves to be flaky
- reuseaddr
- explicitly select the address family
v4: https://lore.kernel.org/all/[email protected]
- improve coding style of patch 5
- switch from netcat to socat (patch 6)
- support exit_wait for bkg() in context manager
- add require_XYZ() helpers (patch 7)
- increase timeouts a little (1,3 -> 5 sec)
v3: https://lore.kernel.org/all/[email protected]
- first two patches are new
- make Remote::cmd() return Popen() object (patch 3)
- always operate on absolute paths (patch 3)
- last two patches are new
v2: https://lore.kernel.org/all/[email protected]
- 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/[email protected]

Patches in v5 All 7 applied

#Subject and filesSizeRepliesApplied
1/7selftests: drv-net: define endpoint structurestools/testing/selftests/drivers/net/lib/py/__init__.py tools/testing/selftests/drivers/net/lib/py/remote.py tools/testing/selftests/drivers/net/lib/py/remote_netns.py +2 more+85 -80 repliesApplied
2/7selftests: drv-net: factor out parsing of the envtools/testing/selftests/drivers/net/lib/py/env.py+26 -170 repliesApplied
3/7selftests: drv-net: construct environment for running tests which require an endpointtools/testing/selftests/drivers/net/README.rst tools/testing/selftests/drivers/net/lib/py/env.py tools/testing/selftests/net/lib/py/__init__.py +1 more+162 -10 repliesApplied
4/7selftests: drv-net: add a trivial ping testtools/testing/selftests/drivers/net/Makefile tools/testing/selftests/drivers/net/ping.py+31 -10 repliesApplied
5/7selftests: net: support matching cases by name prefixtools/testing/selftests/drivers/net/ping.py tools/testing/selftests/net/lib/py/ksft.py+13 -30 repliesApplied
6/7selftests: drv-net: add a TCP ping test case (and useful helpers)tools/testing/selftests/drivers/net/lib/py/env.py tools/testing/selftests/drivers/net/ping.py tools/testing/selftests/net/lib/py/utils.py+68 -10 repliesApplied
7/7selftests: drv-net: add require_XYZ() helpers for validating envtools/testing/selftests/drivers/net/lib/py/env.py tools/testing/selftests/drivers/net/ping.py+34 -11 replyApplied

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchWillem de Bruijn
SeriesR-b T-b
1/7
2/7
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH net-next v5 0/7] selftests: drv-net: support testing with a remote system

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 :)

v5:
- fix rand port generation, and wrap it in a helper in case the random thing proves to be flaky
- reuseaddr
- explicitly select the address family
v4: https://lore.kernel.org/all/[email protected]
- improve coding style of patch 5
- switch from netcat to socat (patch 6)
- support exit_wait for bkg() in context manager
- add require_XYZ() helpers (patch 7)
- increase timeouts a little (1,3 -> 5 sec)
v3: https://lore.kernel.org/all/[email protected]
- first two patches are new
- make Remote::cmd() return Popen() object (patch 3)
- always operate on absolute paths (patch 3)
- last two patches are new
v2: https://lore.kernel.org/all/[email protected]
- 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/[email protected]

Jakub Kicinski (7):
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
selftests: net: support matching cases by name prefix
selftests: drv-net: add a TCP ping test case (and useful helpers)
selftests: drv-net: add require_XYZ() helpers for validating env

 tools/testing/selftests/drivers/net/Makefile  |   5 +-
 .../testing/selftests/drivers/net/README.rst  |  33 ++++
 .../selftests/drivers/net/lib/py/__init__.py  |   1 +
 .../selftests/drivers/net/lib/py/env.py       | 175 ++++++++++++++++--
 .../selftests/drivers/net/lib/py/remote.py    |  15 ++
 .../drivers/net/lib/py/remote_netns.py        |  21 +++
 .../drivers/net/lib/py/remote_ssh.py          |  39 ++++
 tools/testing/selftests/drivers/net/ping.py   |  51 +++++
 .../testing/selftests/net/lib/py/__init__.py  |   1 +
 tools/testing/selftests/net/lib/py/ksft.py    |  13 +-
 tools/testing/selftests/net/lib/py/netns.py   |  31 ++++
 tools/testing/selftests/net/lib/py/utils.py   |  60 +++++-
 12 files changed, 416 insertions(+), 29 deletions(-)
 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
Signature · 1 line
2.44.0