aboutsummaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorGravatar Roxana Nicolescu <roxana.nicolescu@canonical.com> 2023-02-20 12:04:00 +0100
committerGravatar Paolo Abeni <pabeni@redhat.com> 2023-02-21 10:45:08 +0100
commitb60417a9f2b890a8094477b2204d4f73c535725e (patch)
tree1493c90c453e922fb87feb26e9c9649bc80812d8 /tools/testing
parentnet: lan966x: Fix possible deadlock inside PTP (diff)
downloadlinux-b60417a9f2b890a8094477b2204d4f73c535725e.tar.gz
linux-b60417a9f2b890a8094477b2204d4f73c535725e.tar.bz2
linux-b60417a9f2b890a8094477b2204d4f73c535725e.zip
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: 1056691b2680 ("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>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/selftests/net/fib_tests.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
index 5637b5dadabd..70ea8798b1f6 100755
--- a/tools/testing/selftests/net/fib_tests.sh
+++ b/tools/testing/selftests/net/fib_tests.sh
@@ -2065,6 +2065,8 @@ EOF
################################################################################
# main
+trap cleanup EXIT
+
while getopts :t:pPhv o
do
case $o in