blob: d11c9e8184b7d1c30211abe991611941fb7cf3d2 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001#!/bin/bash
2#
3# ============LICENSE_START=======================================================
4# Copyright (C) 2017 AT&T Intellectual Property. All rights
5# reserved.
6# ================================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# ============LICENSE_END============================================
19# ===================================================================
20# ECOMP is a trademark and service mark of AT&T Intellectual Property.
21#
22
Gary Wu13111e92018-09-27 11:31:33 -070023echo "This is ${WORKSPACE}/scripts/modeling-toscaparsers-javatoscachecker/setup_containers.sh"
Gary Wu9abb61c2018-09-27 10:38:50 -070024
25#start docker image
26run-instance.sh nexus3.onap.org:10001/onap/modeling/javatoscachecker:latest modeling_javatoscachecker_1 "-p 8080:8080"
27
28#checker docker image is accesible: picked from clamp, some common script would be good
29TIME_OUT=1200
30INTERVAL=5
31TIME=0
32while [ "$TIME" -lt "$TIME_OUT" ]; do
33 response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:8080/check_template/test_me); echo $response
34
35 if [ "$response" == "404" ]; then
36 echo javatoscachecker service started in $TIME seconds
37 break;
38 fi
39
40 echo Sleep: $INTERVAL seconds before testing if javatoscachecker service is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds
41 sleep $INTERVAL
42 TIME=$(($TIME+$INTERVAL))
43done
44
45if [ "$TIME" -ge "$TIME_OUT" ]; then
46 echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for tests...
47fi
48
49