diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-05-14 20:40:47 +0000 |
---|---|---|
committer | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-05-14 20:40:47 +0000 |
commit | 3667f16983e479f6dbbeeab84fec36b45a7c82ad (patch) | |
tree | 7e4203d1c3f8df3d0459e73dacf5fb47624eeaea /tests | |
parent | 3cc7043df62cf20f908316fefdc065e946eebfa3 (diff) | |
parent | a2261899c69cde406731cf661431ced0a42bb302 (diff) | |
download | gnutls-3667f16983e479f6dbbeeab84fec36b45a7c82ad.tar.gz |
Merge branch 'tmp-fix-GETPORT' into 'master'
Fix endless looping GETPORT in tests/scripts/common.sh
See merge request gnutls/gnutls!997
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/common.sh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh index d34915e1d7..f99ce69d2e 100644 --- a/tests/scripts/common.sh +++ b/tests/scripts/common.sh @@ -59,13 +59,16 @@ check_if_port_listening() { } # Find a port number not currently in use. -GETPORT='rc=0; unset myrandom - if test -n "$RANDOM"; then myrandom=$(($RANDOM + $RANDOM)); fi - if test -z "$myrandom"; then myrandom=$(date +%N | sed s/^0*//); fi - if test -z "$myrandom"; then myrandom=0; fi - while test $rc = 0;do - PORT="$(((($$<<15)|$myrandom) % 63001 + 2000))" - check_if_port_in_use $PORT;rc=$? +GETPORT=' + rc=0 + unset myrandom + while test $rc = 0; do + if test -n "$RANDOM"; then myrandom=$(($RANDOM + $RANDOM)); fi + if test -z "$myrandom"; then myrandom=$(date +%N | sed s/^0*//); fi + if test -z "$myrandom"; then myrandom=0; fi + PORT="$(((($$<<15)|$myrandom) % 63001 + 2000))" + check_if_port_in_use $PORT;rc=$? + echo "PORT=$PORT rc=$rc myrandom=$myrandom" done ' |