3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2021 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
21 # @author Rahul Tyagi (rahul.tyagi@est.tech)
24 export SDNC_CERT_PATH=$WORKSPACE/plans/cps/sdnc/certs
26 #start SDNC containers with docker compose and configuration from docker-compose.yml
27 docker-compose -f $WORKSPACE/plans/cps/sdnc/docker-compose.yml up -d
29 # WAIT 10 minutes maximum and test every 30 seconds if SDNC is up using HealthCheck API
33 while [ "$TIME" -lt "$TIME_OUT" ]; do
34 response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-sdnc" -H "Accept: application/json" -H "Content-Type: application/json" http://$SDNC_HOST:$SDNC_PORT/restconf/operations/SLI-API:healthcheck );
37 if [ "$response" == "200" ]; then
38 echo SDNC started in $TIME seconds
42 echo Sleep: $INTERVAL seconds before testing if SDNC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds
44 TIME=$(($TIME+$INTERVAL))
47 if [ "$TIME" -ge "$TIME_OUT" ]; then
48 echo TIME OUT: karaf session not started in $TIME_OUT seconds... Could cause problems for testing activities...