Skip to content

Commit 94d263f

Browse files
roxanan1996gregkh
authored andcommitted
selftest: fib_tests: Always cleanup before exit
[ Upstream commit b60417a ] 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: 1056691 ("selftests: fib_tests: Make test results more verbose") Signed-off-by: Roxana Nicolescu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 7e41e9a commit 94d263f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/testing/selftests/net/fib_tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,8 @@ EOF
17731773
################################################################################
17741774
# main
17751775

1776+
trap cleanup EXIT
1777+
17761778
while getopts :t:pPhv o
17771779
do
17781780
case $o in

0 commit comments

Comments
 (0)