Skip to content

Commit b4b0549

Browse files
pmachataPaolo Abeni
authored andcommitted
selftests: forwarding: Add a fallback cleanup()
Consistent use of defers obviates the need for a separate test-specific cleanup function -- everything is just taken care of in defers. So in this patch, introduce a cleanup() helper in the forwarding lib.sh, which calls just pre_cleanup() and defer_scopes_cleanup(). Selftests are obviously still free to override the function. Since pre_cleanup() is too entangled with forwarding-specific minutia, the function cannot currently be in net/lib.sh. Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent a6e263f commit b4b0549

File tree

1 file changed

+6
-0
lines changed
  • tools/testing/selftests/net/forwarding

1 file changed

+6
-0
lines changed

tools/testing/selftests/net/forwarding/lib.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,12 @@ tests_run()
14081408
done
14091409
}
14101410

1411+
cleanup()
1412+
{
1413+
pre_cleanup
1414+
defer_scopes_cleanup
1415+
}
1416+
14111417
multipath_eval()
14121418
{
14131419
local desc="$1"

0 commit comments

Comments
 (0)