Skip to content

Commit b60417a

Browse files
roxanan1996Paolo Abeni
authored andcommitted
selftest: fib_tests: Always cleanup before exit
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]>
1 parent 3a70e0d commit b60417a

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
@@ -2065,6 +2065,8 @@ EOF
20652065
################################################################################
20662066
# main
20672067

2068+
trap cleanup EXIT
2069+
20682070
while getopts :t:pPhv o
20692071
do
20702072
case $o in

0 commit comments

Comments
 (0)