diff options
| author | Matthieu Baerts (NGI0) <[email protected]> | 2024-06-07 18:31:02 +0200 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-06-11 19:30:24 -0700 |
| commit | 7e0620bc6a5ec6b340a0be40054f294ca26c010f (patch) | |
| tree | 918025276e05a792e5a10a8499984db637c33448 | |
| parent | bfc65070a3767dd04bff32ef896394ba63cef085 (diff) | |
selftests: net: lib: ignore possible errors
No need to disable errexit temporary, simply ignore the only possible
and not handled error.
Reviewed-by: Geliang Tang <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://lore.kernel.org/r/20240607-upstream-net-next-20240607-selftests-mptcp-net-lib-v1-1-e36986faac94@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
| -rw-r--r-- | tools/testing/selftests/net/lib.sh | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/net/lib.sh index 9155c914c064..b2572aff6286 100644 --- a/tools/testing/selftests/net/lib.sh +++ b/tools/testing/selftests/net/lib.sh @@ -128,25 +128,17 @@ slowwait_for_counter() cleanup_ns() { local ns="" - local errexit=0 local ret=0 - # disable errexit temporary - if [[ $- =~ "e" ]]; then - errexit=1 - set +e - fi - for ns in "$@"; do [ -z "${ns}" ] && continue - ip netns delete "${ns}" &> /dev/null + ip netns delete "${ns}" &> /dev/null || true if ! busywait $BUSYWAIT_TIMEOUT ip netns list \| grep -vq "^$ns$" &> /dev/null; then echo "Warn: Failed to remove namespace $ns" ret=1 fi done - [ $errexit -eq 1 ] && set -e return $ret } |