need to get unused port
authorMarcel Poul <marcel.poul@cern.ch>
Tue, 5 Feb 2013 13:40:27 +0000 (13:40 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 7 Feb 2013 14:07:28 +0000 (15:07 +0100)
org.glite.testsuites.ctb/CANL-C/tests/canl-test-ocsp.sh

index b74df4f..c83408e 100755 (executable)
@@ -127,6 +127,15 @@ else
    test_failed
 fi
 
+nu_port=11112
+max_port=11190
+${SYS_LSOF} -i :${nu_port}
+while [ $? -eq 0 -a ${nu_port} -lt ${max_port} ]
+do
+        nu_port=$((nu_port+1))
+        ${SYS_LSOF} -i :${nu_port}
+done
+
 printf "Starting canl sample server \n"
 ${EMI_CANL_SERVER} -k /etc/grid-security/hostkey.pem \
         -c /etc/grid-security/hostcert.pem -p "${nu_port}" &