From 50ee9d628b2da68cc72933b00a699bf855193eed Mon Sep 17 00:00:00 2001 From: Leonardo Bellini Date: Thu, 15 Mar 2018 04:39:25 -0500 Subject: Integrate optf-has with music - first step Issue-ID: OPTFRA-186 Change-Id: I0e92332af26105273db2a07e2d9bf04f0980338c Signed-off-by: Leonardo Bellini --- test/csit/scripts/optf-has/has/wait_for_port.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 test/csit/scripts/optf-has/has/wait_for_port.sh (limited to 'test/csit/scripts/optf-has/has/wait_for_port.sh') 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 | grep -q '^Connected'; do + sleep 1 +done + +echo "$host port $port is open" + +exit 0 -- cgit 1.2.3-korg