mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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>
This commit is contained in:
parent
a6e263f125
commit
b4b0549a4e
1 changed files with 6 additions and 0 deletions
|
@ -1408,6 +1408,12 @@ tests_run()
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup()
|
||||||
|
{
|
||||||
|
pre_cleanup
|
||||||
|
defer_scopes_cleanup
|
||||||
|
}
|
||||||
|
|
||||||
multipath_eval()
|
multipath_eval()
|
||||||
{
|
{
|
||||||
local desc="$1"
|
local desc="$1"
|
||||||
|
|
Loading…
Add table
Reference in a new issue