diff options
| author | Mark Wielaard <[email protected]> | 2021-09-06 23:04:06 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2021-09-06 23:04:11 +0200 |
| commit | 7880ccb6483e76847cdf1c6c4e45a2180bee820a (patch) | |
| tree | 6d2a49a30f3b8c1a8f600d2378f0481c0bff76cf /tests/debuginfod-subr.sh | |
| parent | 44a36e39fc7df2a3e2f9f278f79f65233d774a48 (diff) | |
tests: Print metrics for both ports on error and fix port selection
On error we would only print the metrics of one port (twice) because
of a typo. Also PORT1 and PORT2 could be equal because of a logic
error. Fix the typo and simplify the port selection by using
non-overlapping ranges to select PORT1 and PORT2.
Diffstat (limited to 'tests/debuginfod-subr.sh')
| -rwxr-xr-x | tests/debuginfod-subr.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/debuginfod-subr.sh b/tests/debuginfod-subr.sh index 3222a2b0..7d238436 100755 --- a/tests/debuginfod-subr.sh +++ b/tests/debuginfod-subr.sh @@ -39,7 +39,7 @@ trap cleanup 0 1 2 3 5 9 15 errfiles_list= err() { echo ERROR REPORTS - for ports in $PORT1 $PORT2 + for port in $PORT1 $PORT2 do echo ERROR REPORT $port metrics curl -s http://127.0.0.1:$port/metrics @@ -129,13 +129,13 @@ archive_test() { get_ports() { while true; do - PORT1=`expr '(' $RANDOM % 100 ')' + $base` + PORT1=`expr '(' $RANDOM % 50 ')' + $base` ss -atn | fgrep ":$PORT1" || break done # Some tests will use two servers, so assign the second var while true; do - PORT2=`expr '(' $RANDOM % 100 ')' + $base` - ss -atn | fgrep ":$PORT2" && $PORT1 -ne $PORT2 || break + PORT2=`expr '(' $RANDOM % 50 ')' + $base + 50` + ss -atn | fgrep ":$PORT2" || break done } |
