selftests: mlxsw: devlink_trap_police: Use defer for test cleanup
authorPetr Machata <petrm@nvidia.com>
Thu, 17 Oct 2024 09:45:52 +0000 (11:45 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 22 Oct 2024 11:33:48 +0000 (13:33 +0200)
commitcebd281f3c753dcbd48b455bdbc6549889196aa0
treec2548d4896c4c375f8594f13e54c9bed13da3a7e
parent919419a8870b33405ef9b0e34e837d407e3888f5
selftests: mlxsw: devlink_trap_police: Use defer for test cleanup

Use the defer framework to schedule cleanups as soon as the command is
executed.

Note that the start_traffic commands in __burst_test() are each sending a
fixed number of packets (note the -c flag) and then ending. They therefore
do not need a matching stop_traffic.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/drivers/net/mlxsw/devlink_trap_policer.sh