summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-04-30 07:14:13 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-04-30 07:14:13 +0200
commitc0124b9c6fff9dda5b76f30bcc7c7e5b287c43d8 (patch)
tree8e8e55ae086155d94e3d15cc10e667a09fbe72c4 /tests/scripts
parent692261d65829af3aef42954a97c5feb10e79faea (diff)
downloadgnutls-c0124b9c6fff9dda5b76f30bcc7c7e5b287c43d8.tar.gz
tests: check whether the randomly generate port is used
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/common.sh8
1 files changed, 7 insertions, 1 deletions
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"