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.
20 # Place the scripts in run order:
22 export NEXUS_USERNAME=docker
23 export NEXUS_PASSWD=docker
24 export NEXUS_DOCKER_REPO=nexus3.onap.org:10001
25 export DMAAP_TOPIC=AUTO
26 export DOCKER_IMAGE_VERSION=2.1-STAGING-latest
27 export CCSDK_DOCKER_IMAGE_VERSION=1.1-STAGING-latest
29 export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
31 if [ "$MTU" == "" ]; then
36 # Clone SDNC repo to get docker-compose for SDNC
37 mkdir -p $WORKSPACE/archives/sdnc
38 cd $WORKSPACE/archives
39 git clone -b master --single-branch --depth=1 http://gerrit.onap.org/r/sdnc/oam.git sdnc
40 cd $WORKSPACE/archives/sdnc
42 unset http_proxy https_proxy
43 cd $WORKSPACE/archives/sdnc/installation/src/main/yaml
45 sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="AUTO"/g" docker-compose.yml
46 docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
48 docker pull $NEXUS_DOCKER_REPO/onap/sdnc-image:$DOCKER_IMAGE_VERSION
49 docker tag $NEXUS_DOCKER_REPO/onap/sdnc-image:$DOCKER_IMAGE_VERSION onap/sdnc-image:latest
51 docker pull $NEXUS_DOCKER_REPO/onap/sdnc-ansible-server-image:$DOCKER_IMAGE_VERSION
52 docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ansible-server-image:$DOCKER_IMAGE_VERSION onap/sdnc-ansible-server-image:latest
54 docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION
55 docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:latest
57 docker pull $NEXUS_DOCKER_REPO/onap/sdnc-ueb-listener-image:$DOCKER_IMAGE_VERSION
58 docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ueb-listener-image:$DOCKER_IMAGE_VERSION onap/sdnc-ueb-listener-image:latest
60 docker pull $NEXUS_DOCKER_REPO/onap/sdnc-dmaap-listener-image:$DOCKER_IMAGE_VERSION
62 docker tag $NEXUS_DOCKER_REPO/onap/sdnc-dmaap-listener-image:$DOCKER_IMAGE_VERSION onap/sdnc-dmaap-listener-image:latest
65 # start SDNC containers with docker compose and configuration from docker-compose.yml
68 # WAIT 5 minutes maximum and check karaf.log for readiness every 10 seconds
74 while [ "$TIME" -lt "$TIME_OUT" ]; do
76 docker exec sdnc_controller_container cat /opt/opendaylight/data/log/karaf.log | grep 'warp coils'
79 echo SDNC karaf started in $TIME seconds
83 echo Sleep: $INTERVAL seconds before testing if SDNC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds
85 TIME=$(($TIME+$INTERVAL))
88 if [ "$TIME" -ge "$TIME_OUT" ]; then
89 echo TIME OUT: karaf session not started in $TIME_OUT seconds, setup failed
93 num_bundles=$(docker exec -i sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d' ' -f1)
94 num_failed_bundles=$(docker exec -i sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l)
95 failed_bundles=$(docker exec -i sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure)
96 echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles.
98 if [ "$num_failed_bundles" -ge 1 ]; then
99 echo "The following bundle(s) are in a failed state: "
100 echo " $failed_bundles"
103 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
104 ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}"