Commit 7f46615
selftests: RED: Use defer for test cleanup
Instead of having a suite of dedicated cleanup functions, use the defer
framework to schedule cleanups right as their setup functions are run.
The sleep after stop_traffic() in mlxsw selftests is necessary, but
scheduling it as "defer sleep; defer stop_traffic" is silly. Instead, add a
local helper to stop traffic and sleep afterwards.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>1 parent 0e07d5d commit 7f46615
File tree
4 files changed
+149
-181
lines changed- tools/testing/selftests
- drivers/net/mlxsw
- net/forwarding
4 files changed
+149
-181
lines changed
0 commit comments