]> git.baikalelectronics.ru Git - kernel.git/commit
selftest: fib_tests: Always cleanup before exit
authorRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 20 Feb 2023 11:04:00 +0000 (12:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:43 +0000 (16:43 +0100)
commit62543e7942b08d178599457e3e66450cfa82addf
tree0e1489450e63c9dfe5f7b8fde923f3e2a12acccb
parenta28a723afc42c71ba67a8d8f3286a8059048a4b6
selftest: fib_tests: Always cleanup before exit

[ Upstream commit b60417a9f2b890a8094477b2204d4f73c535725e ]

Usage of `set -e` before executing a command causes immediate exit
on failure, without cleanup up the resources allocated at setup.
This can affect the next tests that use the same resources,
leading to a chain of failures.

A simple fix is to always call cleanup function when the script exists.
This approach is already used by other existing tests.

Fixes: c4112e27f48b ("selftests: fib_tests: Make test results more verbose")
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
Link: https://lore.kernel.org/r/20230220110400.26737-2-roxana.nicolescu@canonical.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/net/fib_tests.sh