diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-20 18:29:17 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-20 18:29:17 -0400 |
commit | f02aeae258f3da4c93f642d941812d8b2129a68e (patch) | |
tree | 692279be3be45ee4f632ff0b743e61713edf2766 /lib | |
parent | 76989bfefd3609ef6ce33819c7bb0ea8570ec8e1 (diff) |
lib/common.sh: Use pipefail
++ for catching more errors
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common.sh | 1 | ||||
-rw-r--r-- | lib/libktest.sh | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/common.sh b/lib/common.sh index 11de1c5..cd943b3 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -2,6 +2,7 @@ set -o nounset set -o errtrace set -o errtrace +set -o pipefail trap 'echo "Error $? from: $BASH_COMMAND, exiting" >&2' ERR diff --git a/lib/libktest.sh b/lib/libktest.sh index ecdbd22..86073e0 100644 --- a/lib/libktest.sh +++ b/lib/libktest.sh @@ -248,6 +248,9 @@ save_env() get_unused_port() { + # This probably shouldn't be needed, but I was unable to determine which + # part of the pipeline was returning an error: + set +o pipefail comm -23 --nocheck-order \ <(seq 10000 65535) \ <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep '[0-9]\{1,5\}' | sort -n | uniq) \ |