]> www.infradead.org Git - users/hch/misc.git/commit
selftests/bpf: test_xdp_veth: Use a dedicated namespace
authorBastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Wed, 12 Feb 2025 11:11:10 +0000 (12:11 +0100)
committerMartin KaFai Lau <martin.lau@kernel.org>
Tue, 18 Feb 2025 21:56:34 +0000 (13:56 -0800)
commit19a9484c1bbc4ccbe7cc69ec1995fec91bc0bdb6
treeaf1e96987a7761af012e0fa6cede6e376998258d
parent6bdac0e317e9265664d02c79d4f0fd3f80f50cdd
selftests/bpf: test_xdp_veth: Use a dedicated namespace

Tests use the root network namespace, so they aren't fully independent
of each other. For instance, the index of the created veth interfaces
is incremented every time a new test is launched.

Wrap the network topology in a network namespace to ensure full
isolation. Use the append_tid() helper to ensure the uniqueness of this
namespace's name during parallel runs.
Remove the use of the append_tid() on the veth names as they now belong
to an already unique namespace.
Simplify cleanup_network() by directly deleting the namespaces

Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250212-redirect-multi-v5-2-fd0d39fca6e6@bootlin.com
tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c