From: Nikos Mavrogiannopoulos Date: Sat, 30 Apr 2016 05:14:13 +0000 (+0200) Subject: tests: check whether the randomly generate port is used X-Git-Tag: gnutls_3_5_0~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0124b9c6fff9dda5b76f30bcc7c7e5b287c43d8;p=thirdparty%2Fgnutls.git tests: check whether the randomly generate port is used --- diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh index fd6588d52f..b338201cb2 100644 --- a/tests/scripts/common.sh +++ b/tests/scripts/common.sh @@ -18,7 +18,13 @@ # along with this file; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -RPORT="$(((($$<<15)|RANDOM) % 63001 + 2000))" +rc=0 +while test $rc = 0 +do + RPORT="$(((($$<<15)|RANDOM) % 63001 + 2000))" + netstat -anlt|grep "\:$RPORT" + rc=$? +done fail() { PID="$1"