aboutsummaryrefslogtreecommitdiffstats
path: root/plans/appc/healthcheck/bundle_query.sh
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2020-04-15 14:24:27 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-15 14:24:27 +0000
commit5f7785e5acd4468a04fb3f038b1e8f71f6ce2dfd (patch)
tree7da7ba316983eb886802444aeeec9cd17cf2ad5f /plans/appc/healthcheck/bundle_query.sh
parent426ddc1c61efc12b95aa1013d9137411a4e46d5e (diff)
parentfee760e3d4cf4853bc934d24a8fffe16ecd001e6 (diff)
Merge "revise appc csit healthcheck"
Diffstat (limited to 'plans/appc/healthcheck/bundle_query.sh')
-rwxr-xr-xplans/appc/healthcheck/bundle_query.sh14
1 files changed, 5 insertions, 9 deletions
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