# Modifications copyright (c) 2021 AT&T Intellectual Property
#
-#
+# Remove all dangling images
+docker image prune -f
###################### Netconf Simulator Setup ######################
mkdir ${WORKSPACE}/archives/pnf-simulator
git clone "https://gerrit.onap.org/r/integration/simulators/pnf-simulator" ${WORKSPACE}/archives/pnf-simulator
-# Fix docker-compose to add nexus repo for onap dockers
+# Fix docker-compose to add nexus repo for onap dockers
mv ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml.orig
cat ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml.orig | sed -e "s/image: onap/image: nexus3.onap.org:10001\/onap/" > ${WORKSPACE}/archives/pnf-simulator/netconfsimulator/docker-compose.yml
unset http_proxy https_proxy
+# Append test data to standard data init file to create db init script
+cat ${WORKSPACE}/../installation/sdnc/src/main/resources/sdnctl.dump ${WORKSPACE}/scripts/csit-data.sql > ${WORKSPACE}/archives/csit-dbinit.sql
# start SDNC containers with docker compose and configuration from docker-compose.yml
docker-compose -f ${SCRIPTS}/docker-compose.yml up -d
+
# WAIT 5 minutes maximum and check karaf.log for readiness every 10 seconds
TIME_OUT=300
num_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | tail -1 | cut -d' ' -f1)
if [ "$num_bundles" -ge 333 ]; then
- num_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | tail -1 | cut -d' ' -f1)
-
- num_failed_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | grep Failure | wc -l)
- failed_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | grep Failure)
+ num_failed_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | grep -w Failure | wc -l)
+ failed_bundles=$(docker exec -i ${SDNC_CONTAINER_NAME} sh -c "echo '' | /opt/opendaylight/current/bin/client bundle:list" | grep -w Failure)
echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles.
fi
sed -i "s/pnfaddr/${LOCAL_IP}/g" "${REQUEST_DATA_PATH}"/mount.xml
+# Load test dgs
+docker exec ${SDNC_CONTAINER_NAME} mkdir -p /tmp/gra.patch
+
+for file in ${WORKSPACE}/plans/sdnc/testdata/*xml
+do
+ docker cp $file ${SDNC_CONTAINER_NAME}:/tmp/gra.patch
+ mname=$(basename $file | cut -d. -f1| cut -d_ -f1)
+ bname=$(basename $file | cut -d. -f1| cut -d_ -f2-)
+ echo ${mname} ${bname} aai-disabled sync >> ${WORKSPACE}/archives/graph.versions
+done
+docker cp ${WORKSPACE}/archives/graph.versions ${SDNC_CONTAINER_NAME}:/tmp/gra.patch
+docker exec ${SDNC_CONTAINER_NAME} /opt/onap/sdnc/svclogic/bin/svclogic.sh install /tmp/gra.patch /opt/onap/sdnc/svclogic/config/svclogic.properties
+
+
#########################################################################
# Export SDNC, AAF-Certservice-Cient, Netconf-Pnp-Simulator Continer Names