aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/scripts/optf-has/has/wait_for_port.sh
diff options
context:
space:
mode:
authorLeonardo Bellini <leonardo.bellini@att.com>2018-03-15 04:39:25 -0500
committerLeonardo Bellini <leonardo.bellini@att.com>2018-03-15 04:39:40 -0500
commit50ee9d628b2da68cc72933b00a699bf855193eed (patch)
treee7e6629dee8e69e55e06d2002a5fd891ff6133e2 /test/csit/scripts/optf-has/has/wait_for_port.sh
parent5ae17fe0c827f93e2065a1648fc7073009fe293e (diff)
Integrate optf-has with music - first step
Issue-ID: OPTFRA-186 Change-Id: I0e92332af26105273db2a07e2d9bf04f0980338c Signed-off-by: Leonardo Bellini <leonardo.bellini@att.com>
Diffstat (limited to 'test/csit/scripts/optf-has/has/wait_for_port.sh')
-rwxr-xr-xtest/csit/scripts/optf-has/has/wait_for_port.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/csit/scripts/optf-has/has/wait_for_port.sh b/test/csit/scripts/optf-has/has/wait_for_port.sh
new file mode 100755
index 000000000..10f08ded1
--- /dev/null
+++ b/test/csit/scripts/optf-has/has/wait_for_port.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+if [[ $# -ne 2 ]]; then
+ echo "Usage: wait-for-port hostname port" >&2
+ exit 1
+fi
+
+host=$1
+port=$2
+
+echo "Waiting for $host port $port open"
+until telnet $host $port </dev/null 2>/dev/null | grep -q '^Connected'; do
+ sleep 1
+done
+
+echo "$host port $port is open"
+
+exit 0