Fixed set -x
This commit is contained in:
parent
26c3927e75
commit
736703054e
1 changed files with 7 additions and 7 deletions
14
runtest.sh
14
runtest.sh
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
set x
|
||||
set -x
|
||||
set -euo pipefail
|
||||
trap 'echo "[✖] Execution halted at line $LINENO. An unexpected error occurred. Please contact your nearest bash therapist." >&2' ERR
|
||||
|
||||
|
@ -115,18 +115,18 @@ while [ "$COUNTER" -lt "$NUM_TESTS" ]; do
|
|||
local mode="$2"
|
||||
local direction="$3"
|
||||
local args=("-c" "$target" "-J" "-t" "10")
|
||||
|
||||
|
||||
if [ "$mode" = "udp" ]; then
|
||||
args+=("-u")
|
||||
fi
|
||||
|
||||
|
||||
if [ "$direction" = "down" ]; then
|
||||
args+=("--reverse")
|
||||
fi
|
||||
|
||||
|
||||
local tmp_err
|
||||
tmp_err=$(mktemp)
|
||||
|
||||
|
||||
local result
|
||||
result=$(iperf3 "${args[@]}" 2>"$tmp_err" | jq -r '
|
||||
if .error then
|
||||
|
@ -140,7 +140,7 @@ while [ "$COUNTER" -lt "$NUM_TESTS" ]; do
|
|||
else
|
||||
"unexpected-format"
|
||||
end' || echo "execution-failed")
|
||||
|
||||
|
||||
if [[ "$result" == "iperf3-error" || "$result" == "no-end" || "$result" == "unexpected-format" || "$result" == "execution-failed" ]]; then
|
||||
echo "$(date -Iseconds),iperf $mode $direction to $target failed with '$result'" >> "$FAILURE_LOG"
|
||||
echo "[stderr] $(cat "$tmp_err")" >> "$FAILURE_LOG"
|
||||
|
@ -148,7 +148,7 @@ while [ "$COUNTER" -lt "$NUM_TESTS" ]; do
|
|||
else
|
||||
echo "$result"
|
||||
fi
|
||||
|
||||
|
||||
rm -f "$tmp_err"
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue