selftests/bpf: add missing ns cleanups in btf_skc_cls_ingress
authorAlexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Sun, 20 Oct 2024 19:22:54 +0000 (21:22 +0200)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 21 Oct 2024 18:49:15 +0000 (11:49 -0700)
commit0335dd6b5a4c178d9ae34694a0be7862873378bd
treee796d6597f4a869364cb3964e5f007f924afe67f
parent6414b3e5d5d44cd214161abf2ce2221d9e9de7bf
selftests/bpf: add missing ns cleanups in btf_skc_cls_ingress

btf_skc_cls_ingress.c currently runs two subtests, and create a
dedicated network namespace for each, but never cleans up the created
namespace once the test has ended.

Add missing namespace cleanup after each subtest to avoid accumulating
namespaces for each new subtest. While at it, switch namespace
management to netns_{new,free}

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20241020-syncookie-v2-2-2db240225fed@bootlin.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c