Re: [PATCH bpf-next] selftests/bpf: ensure proper root namespace cleanup when test fail

From: Stanislav Fomichev
Date: Mon Dec 02 2024 - 11:23:12 EST


On 11/28, Alexis Lothoré (eBPF Foundation) wrote:
> serial_test_flow_dissector_namespace manipulates both the root net
> namespace and a dedicated non-root net namespace. If for some reason a
> program attach on root namespace succeeds while it was expected to
> fail, the unexpected program will remain attached to the root namespace,
> possibly affecting other runs or even other tests in the same run.
>
> Fix undesired test failure side effect by explicitly detaching programs
> on failing tests expecting attach to fail. As a side effect of this
> change, do not test errno value if the tested operation do not fail.
>
> Fixes: 284ed00a59dd ("selftests/bpf: migrate flow_dissector namespace exclusivity test")
> Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@xxxxxxxxxxx>

Acked-by: Stanislav Fomichev <sdf@xxxxxxxxxxx>