summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2017-01-05 10:35:29 +0200
committerAlon Bar-Lev <alon.barlev@gmail.com>2017-01-20 13:38:08 +0200
commitb9e7ae866f18206aed8a4dffd84c8f7cbcdd9211 (patch)
treee04a0bf9aee5063c69a03528bcd3eb6739e9cff5 /tests/scripts
parentaefab4a220faee14f33e3d9831c5673a4caf9694 (diff)
downloadgnutls-b9e7ae866f18206aed8a4dffd84c8f7cbcdd9211.tar.gz
tests: remove bash usage
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/common.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh
index 8e82660155..3cf841c25b 100644
--- a/tests/scripts/common.sh
+++ b/tests/scripts/common.sh
@@ -19,11 +19,9 @@
# along with this file; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# due to the use of $RANDOM, this script requires bash
-
export TZ="UTC"
-GETPORT='rc=0;while test $rc = 0;do PORT="$(((($$<<15)|RANDOM) % 63001 + 2000))";
+GETPORT='rc=0;myrandom=$(date +%N | sed 's/^0*//');while test $rc = 0;do PORT="$(((($$<<15)|$myrandom) % 63001 + 2000))";
netstat -anl|grep "[\:\.]$PORT" >/dev/null 2>&1;
rc=$?;done;'