This should prevent the 90 minutes timeouts
in CSIT tests.
Change-Id: Ia9491462f4c3b83564584eb9f85551570e3c6342
Issue-ID: POLICY-1712
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
exit 1
fi
-host=$1
-port=$2
+export host=$1
+export port=$2
echo "Waiting for $host port $port open"
-until nc -vz $host $port 2> /dev/null; do
- sleep 1
-done
+timeout 120 bash -c 'until nc -vz "$host" "$port"; do echo -n "."; sleep 1; done'
+rc=$?
-echo "$host port $port is open"
+if [[ $rc != 0 ]]; then
+ echo "$host port $port cannot be reached"
+ exit $rc
+fi
+echo "$host port $port is open"
exit 0