File indexing completed on 2023-03-17 11:16:38
0001
0002
0003 port=8080
0004
0005
0006 while [ $port -lt 8090 ]; do
0007
0008 d=`grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}' | grep 127.0.0.1:$port |wc -l`
0009 if [ $d -eq "0" ]
0010 then
0011 break
0012 fi
0013 let port=port+1
0014 done
0015
0016 if [ $port -ge 8090 ]
0017 then
0018 echo "could not find a port to use. Stopping test"
0019 exit 1
0020 fi
0021
0022 echo "Testing jupyter using port $port"
0023 exit 0
0024
0025
0026 timeout 20s jupyter notebook --no-browser --port=$port
0027
0028
0029 if [ $? -eq 124 ]
0030 then
0031 echo "Success (notebook stopped after 15s)"
0032 exit 0
0033 else
0034 echo "There was an error starting the notebook"
0035 exit $?
0036 fi
0037
0038