diff options
author | Ritu Sood <ritu.sood@intel.com> | 2020-11-19 18:08:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-11-19 18:08:35 +0000 |
commit | 4daf1b4aaa51486e47e47f970f5e6ffd4fa20490 (patch) | |
tree | e4c9169e98086e89a44b9e462634dd85960ab078 /deployments/_functions.sh | |
parent | b6e5bdcd211bb574488f64ff7ed95967eca42d0e (diff) | |
parent | 6631ca7445b85b2c21ad3b9639a7b2cecc1fe480 (diff) |
Merge "Wait for service to be listening before running tests"
Diffstat (limited to 'deployments/_functions.sh')
-rwxr-xr-x | deployments/_functions.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/deployments/_functions.sh b/deployments/_functions.sh index 47074433..c0feed0d 100755 --- a/deployments/_functions.sh +++ b/deployments/_functions.sh @@ -34,3 +34,14 @@ EOF function start_all { docker-compose up -d } + +function wait_for_service { + for try in {0..59}; do + echo "$(date +%H:%M:%S) - Waiting for service up" + sleep 1 + if $(curl http://localhost:9015/v1 &>/dev/null); then + return 0 + fi + done + exit 1 +} |