From fee760e3d4cf4853bc934d24a8fffe16ecd001e6 Mon Sep 17 00:00:00 2001 From: Taka Cho Date: Thu, 9 Apr 2020 17:59:43 -0400 Subject: revise appc csit healthcheck revise APPC csit healthcheck Issue-ID: APPC-1861 Change-Id: If573cbe54d47f251da0d37f7d4da13fd17b53145 Signed-off-by: Taka Cho --- plans/appc/healthcheck/bundle_query.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'plans/appc/healthcheck/bundle_query.sh') 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 -- cgit 1.2.3-korg