Short Term fix for javax.servlet-api
[sdnc/oam.git] / csit / plans / sdnc / setup.sh
index ba1c0b8..5b8e4fa 100644 (file)
@@ -18,7 +18,8 @@
 # Modifications copyright (c) 2021 AT&T Intellectual Property
 #
 
-# 
+# Remove all dangling images
+docker image prune -f
 
 ###################### Netconf Simulator Setup ######################
 
@@ -30,7 +31,7 @@ fi
 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
 
@@ -108,10 +109,8 @@ fi
 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