aboutsummaryrefslogtreecommitdiffstats
path: root/plans/so/integration-etsi-testing/config/wait-for-container.sh
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2019-09-10 16:02:32 +0100
committerwaqas.ikram <waqas.ikram@est.tech>2019-09-10 16:06:03 +0100
commit2deca5dd5f9344e8d81aebc2b4bc0994add9a2ef (patch)
tree3f1d52d3fe451f682fb37c7f85abb757f1f8810d /plans/so/integration-etsi-testing/config/wait-for-container.sh
parent8cfb9aed2aff1102e2ce75438f2b47b0fb063096 (diff)
Changing sdc directory to unzipped_sdc_csar
Change-Id: I82c771869b58bcbc0357b0e7f9774e3487c04017 Issue-ID: INT-1243 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'plans/so/integration-etsi-testing/config/wait-for-container.sh')
-rwxr-xr-xplans/so/integration-etsi-testing/config/wait-for-container.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/plans/so/integration-etsi-testing/config/wait-for-container.sh b/plans/so/integration-etsi-testing/config/wait-for-container.sh
index 598715d9..35ee2641 100755
--- a/plans/so/integration-etsi-testing/config/wait-for-container.sh
+++ b/plans/so/integration-etsi-testing/config/wait-for-container.sh
@@ -118,16 +118,23 @@ process_arguments()
exit 1
fi
+ result=$(docker inspect --format '{{.State.Running}}' $CONTAINER_NAME)
+
+ if [ $result != "true" ] ; then
+ echo "$SCRIPT_NAME $(current_timestamp) ERROR: $CONTAINER_NAME container is not running"
+ exit 1
+ fi
+
HOST_IP=$(docker inspect --format '{{ index .NetworkSettings.Networks "'$NETWORK_NAME'" "IPAddress"}}' $CONTAINER_NAME)
- if [ $? -ne 0 ]; then
+ if [ $? -ne 0 ] || [ -z $HOST_IP ] ; then
echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to find HOST IP using network name: $NETWORK_NAME and container name: $CONTAINER_NAME"
exit 1
fi
PORT=$(docker port $CONTAINER_NAME | cut -c1-$(docker port $CONTAINER_NAME | grep -aob '/' | grep -oE '[0-9]+'))
- if [ $? -ne 0 ]; then
+ if [ $? -ne 0 ] || [ -z $PORT ] ; then
echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to find PORT using project name: $PROJECT_NAME and container name: $CONTAINER_NAME"
exit 1
fi