X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=plans%2Fappc%2Fhealthcheck%2Fbundle_query.sh;h=2c9da710446efc7301a1d2fd03ca8bdee191c557;hb=fee760e3d4cf4853bc934d24a8fffe16ecd001e6;hp=3801d0a12473c362d078a872842aff4c8ec44cd3;hpb=295b9221b5cd7f3fe160e5048d607e82675f321d;p=integration%2Fcsit.git diff --git a/plans/appc/healthcheck/bundle_query.sh b/plans/appc/healthcheck/bundle_query.sh index 3801d0a1..2c9da710 100755 --- a/plans/appc/healthcheck/bundle_query.sh +++ b/plans/appc/healthcheck/bundle_query.sh @@ -17,19 +17,15 @@ SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo $SCRIPTS +num_active_bundles=$(docker exec --tty appc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Active | wc -l) +num_failed_bundles=$(docker exec --tty appc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l) +failed_bundles=$(docker exec --tty appc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure) -num_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d\| -f1) -#num_failed_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l) -num_failed_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l) -failed_bundles=$(docker exec appc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure) +echo "There are $num_failed_bundles failed bundles and $num_active_bundles active bundles." -echo "There are $num_failed_bundles failed bundles out of $num_bundles installed bundles." - -if [ "$num_failed_bundles" -ge 1 ] || [ "$num_bundles" == "" ]; then - echo "There are $num_bundles bundles with $num_failed_bundles in a failed state. " +if [ "$num_failed_bundles" -ge 1 ] || [ "$num_active_bundles" == "" ]; then echo "The following bundle(s) are in a failed state: " echo " $failed_bundles" exit 1; fi - exit 0