selftests/net: add netkit container env and test
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
- v3 Latest4 patches 0 repliesApplied 4/4
- v24 patches 3 repliesSuperseded
- v14 patches 3 repliesSuperseded
Changes in v3 from the cover letter
- add __all__ in ynl.py to declare its API
- update diagram to only use documentation addresses
- don't try to parse invalid prefix addrs w/o prefix len
- make pylint happier
Patches in v3 All 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | selftests/net: Add bpf skb forwarding programtools/ | +49 | 0 replies | Applied |
| 2/4 | selftests/net: Export Netlink class via lib.pytools/ tools/ tools/ | +12 | 0 replies | Applied |
| 3/4 | selftests/net: Add env for container based teststools/ tools/ tools/ +1 more | +253 | 0 replies | Applied |
| 4/4 | selftests/net: Add netkit container ping testtools/ tools/ tools/ | +27 | 0 replies | Applied |
Reviews trailers per patch
1 of 4 patches has a Reviewed-by or Acked-by.
| Patch | Stanislav Fomichev | Nikolay Aleksandrov |
|---|---|---|
| 1/4 | A-b | R-b |
| 2/4 | ||
| 3/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next v3 0/4] selftests/net: add netkit container env and test
Add a new Python selftest env NetDrvContEnv that sets up a pair of netkit netdevs, with one inside of a netns, and a bpf prog that forwards skbs from NETIF to the netkit inside the netns.
NETIF = "eth0" LOCAL_V6 = "2001:db8:1::1" REMOTE_V6 = "2001:db8:1::2"
LOCAL_PREFIX_V6 = "2001:db8:2::0/64"
+-----------------------------+ +------------------------------+
dst | INIT NS | | TEST NS |
2001: | +---------------+ | | |
db8:2::2| | NETIF | | bpf | |
+---|>| 2001:db8:1::1 | |redirect| +-------------------------+ |
| | | |-----------|--------|>| Netkit | |
| | +---------------+ | _peer | | nk_guest | |
| | +-------------+ Netkit pair | | | fe80::2/64 | |
| | | Netkit |.............|........|>| 2001:db8:2::2/64 | |
| | | nk_host | | | +-------------------------+ |
| | | fe80::1/64 | | | |
| | +-------------+ | | route: |
| | | | default |
| | route: | | via fe80::1 dev nk_guest |
| | 2001:db8:2::2/128 | +------------------------------+
| | via fe80::2 dev nk_host |
| +-----------------------------+
|
| +---------------+
| | REMOTE |
+---| 2001:db8:1::2 |
+---------------+I will use this series for queue leasing selftests. Include a basic ping test in this series as demonstration.
v3:
- add __all__ in ynl.py to declare its API
- update diagram to only use documentation addresses
- don't try to parse invalid prefix addrs w/o prefix len
- make pylint happier
v2:
- remove LOCAL_PREFIX_V4 in docs
- mention in docs that LOCAL_PREFIX_V6 must not match LOCAL_V6
- skip test if LOCAL_PREFIX_V6 matches LOCAL_V6
- move NetDrvContEnv class vars above parent ctor
- improve ASCII diagram to show remote, route, example addrs
- use Python ipaddress instead of str manipulations
- set forwarding/accept_ra
David Wei (4):
selftests/net: Add bpf skb forwarding program selftests/net: Export Netlink class via lib.py selftests/net: Add env for container based tests selftests/net: Add netkit container ping test
.../testing/selftests/drivers/net/README.rst | 38 ++++ .../testing/selftests/drivers/net/hw/Makefile | 1 + tools/testing/selftests/drivers/net/hw/config | 3 + .../drivers/net/hw/lib/py/__init__.py | 7 +- .../selftests/drivers/net/hw/nk_forward.bpf.c | 49 +++++ .../selftests/drivers/net/hw/nk_netns.py | 23 ++ .../selftests/drivers/net/lib/py/__init__.py | 11 +- .../selftests/drivers/net/lib/py/env.py | 207 ++++++++++++++++++ .../testing/selftests/net/lib/py/__init__.py | 4 +- tools/testing/selftests/net/lib/py/ynl.py | 10 +- 10 files changed, 341 insertions(+), 12 deletions(-) create mode 100644 tools/testing/selftests/drivers/net/hw/nk_forward.bpf.c create mode 100755 tools/testing/selftests/drivers/net/hw/nk_netns.py
Signature · 1 line
2.47.3