Print docker logs in CSITs for 2 cps-and-ncmp instances 37/138437/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Fri, 12 Jul 2024 10:58:40 +0000 (11:58 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Fri, 12 Jul 2024 11:04:06 +0000 (12:04 +0100)
Following introduction of 2 instances of cps-and-ncmp,
CSIT logs show an error "No such container: cps-and-ncmp".
This commit prints docker logs for each cps-and-ncmp container.

Issue-ID: CPS-2038
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: If3ed4590cef0f5b59d74e62c84f6c6e72edfd411

csit/plans/cps/teardown.sh

index 7beb907..30732df 100755 (executable)
 # Modifications copyright (c) 2017 AT&T Intellectual Property
 # Modifications copyright (c) 2020 Samsung Electronics Co., Ltd.
 # Modifications Copyright (C) 2021 Pantheon.tech
-# Modifications Copyright (C) 2021 Nordix Foundation
+# Modifications Copyright (C) 2021-2024 Nordix Foundation
 # Branched from ccsdk/distribution to this repository Feb 23, 2021
 #
 echo '================================== docker info =========================='
 docker ps -a
 
 echo '================================== CPS-NCMP Logs ========================'
-docker logs cps-and-ncmp
+for CONTAINER_ID in $(docker ps --filter "name=cps-and-ncmp" --format "{{.ID}}"); do
+    echo "CPS-NCMP Logs for container: $CONTAINER_ID"
+    docker logs "$CONTAINER_ID"
+done
 
 echo '================================== DMI Logs ============================='
 docker logs ncmp-dmi-plugin