3 # Copyright 2016-2017 Huawei Technologies Co., Ltd.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Modifications copyright (c) 2017 AT&T Intellectual Property
18 # Modifications copyright (c) 2020 Samsung Electronics Co., Ltd.
21 export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
22 export NEXUS_DOCKER_REPO="nexus3.onap.org:10001"
23 export NEXUS_USERNAME=docker
24 export NEXUS_PASSWD=docker
25 export DMAAP_TOPIC=AUTO
27 if [ "$UNIQUE_DOCKER_TAG" == "" ]; then
28 export CCSDK_DOCKER_IMAGE_VERSION=latest
30 source "${WORKSPACE}/../version.properties"
31 export CCSDK_DOCKER_IMAGE_VERSION=${snapshot_version}-${UNIQUE_DOCKER_TAG}
34 if [ "$MTU" == "" ]; then
38 # Copy default docker-compose.yaml to archives for CSIT modification
39 mkdir -p $WORKSPACE/archives/yaml
40 cp $WORKSPACE/../src/main/yaml/docker-compose.yml $WORKSPACE/archives/yaml
41 cd $WORKSPACE/archives/yaml
42 unset http_proxy https_proxy
44 sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="AUTO"/g" docker-compose.yml
45 docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
47 docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-alpine-image:$CCSDK_DOCKER_IMAGE_VERSION
49 docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION
51 # start CCSDK containers with docker compose and configuration from docker-compose.yml
52 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > docker-compose
53 chmod +x docker-compose
54 ./docker-compose up -d
56 # WAIT 5 minutes maximum and check karaf.log for readiness every 10 seconds
61 while [ "$TIME" -lt "$TIME_OUT" ]; do
63 docker exec ccsdk_odlsli_container cat /opt/opendaylight/data/log/karaf.log | grep 'warp coils'
66 echo CCSDK karaf started in $TIME seconds
70 echo Sleep $INTERVAL seconds before testing if CCSDK is up. Total wait time up until now is $TIME seconds. Timeout is $TIME_OUT seconds
72 TIME=$(($TIME+$INTERVAL))
75 if [ "$TIME" -ge "$TIME_OUT" ]; then
76 echo TIME OUT: karaf session not started in $TIME_OUT seconds, setup failed
80 num_bundles=$(docker exec -i ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d' ' -f1)
82 if [ "$num_bundles" -ge 333 ]; then
83 num_bundles=$(docker exec -i ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d' ' -f1)
84 num_failed_bundles=$(docker exec -i ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l)
85 failed_bundles=$(docker exec -i ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | grep Failure)
86 echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles.
89 if [ "$num_failed_bundles" -ge 1 ]; then
90 echo "The following bundle(s) are in a failed state: "
91 echo " $failed_bundles"
94 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
95 ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}"