]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/net: Add env for container based tests
authorDavid Wei <dw@davidwei.uk>
Thu, 5 Mar 2026 18:18:02 +0000 (10:18 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Mar 2026 21:11:17 +0000 (13:11 -0800)
commit3f74d5bb807ee500cb68f167df7dc4e4252a42ec
tree0636ec9548c8d4b55b1c54e2fd47feff4e0e0578
parent68ab8ba927758d77439785661f1f8b2a47318c5a
selftests/net: Add env for container based tests

Add an env NetDrvContEnv for container based selftests. This automates
the setup of a netns, netkit pair with one inside the netns, and a BPF
program that forwards skbs from the NETIF host inside the container.

Currently only netkit is used, but other virtual netdevs e.g. veth can
be used too.

Expect netkit container datapath selftests to have a publicly routable
IP prefix to assign to netkit in a container, such that packets will
land on eth0. The BPF skb forward program will then forward such packets
from the host netns to the container netns.

Signed-off-by: David Wei <dw@davidwei.uk>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://patch.msgid.link/20260305181803.2912736-4-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/README.rst
tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
tools/testing/selftests/drivers/net/lib/py/__init__.py
tools/testing/selftests/drivers/net/lib/py/env.py