aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/datafilecollector-testharness/common
diff options
context:
space:
mode:
authorecaiyanlinux <martin.c.yan@est.tech>2019-08-30 13:39:30 +0000
committerecaiyanlinux <martin.c.yan@est.tech>2019-08-30 13:39:30 +0000
commitec8c60c7c969f9fc2cdc98cdfd5c5f0ea85f5f6f (patch)
tree8c590a0127714d2284235ff9d308d7b469c088ae /test/mocks/datafilecollector-testharness/common
parent796e8fe4255036b5785a2071ddd6a0240464556a (diff)
Integrating DfC to use TLS sidecar container
Change-Id: I111bc5596346db70923645dcfe79af3e639c978c Issue-ID: DCAEGEN2-1702 Signed-off-by: ecaiyanlinux <martin.c.yan@est.tech>
Diffstat (limited to 'test/mocks/datafilecollector-testharness/common')
-rwxr-xr-xtest/mocks/datafilecollector-testharness/common/testcase_common.sh29
1 files changed, 15 insertions, 14 deletions
diff --git a/test/mocks/datafilecollector-testharness/common/testcase_common.sh b/test/mocks/datafilecollector-testharness/common/testcase_common.sh
index 02aae7195..deed26dfd 100755
--- a/test/mocks/datafilecollector-testharness/common/testcase_common.sh
+++ b/test/mocks/datafilecollector-testharness/common/testcase_common.sh
@@ -356,7 +356,7 @@ __docker_rm() {
}
__start_dfc_image() {
-
+ set -x
if [ $# != 2 ]; then
__print_err "need tow args, <dfc-instance-name> 0.."$$DFC_MAX_IDX
exit 1
@@ -375,20 +375,20 @@ __start_dfc_image() {
docker network ls| grep $DOCKER_SIM_NWNAME > /dev/null || docker network create $DOCKER_SIM_NWNAME
echo "Starting DFC: " $appname " with ports mapped to " $localport " and " $localport_secure " in docker network "$DOCKER_SIM_NWNAME
-
- docker run -d -p $localport":8100" -p $localport_secure":8433" --network=$DOCKER_SIM_NWNAME -e CONSUL_HOST=$CONSUL_HOST -e CONSUL_PORT=$CONSUL_PORT -e CONFIG_BINDING_SERVICE=$CONFIG_BINDING_SERVICE -e HOSTNAME=$appname --name $appname $DFC_IMAGE > /dev/null
-
+ docker run -d --volume $(pwd)/../simulator-group/tls/:/opt/app/datafile/etc/cert/ -p $localport":8100" -p $localport_secure":8433" --network=$DOCKER_SIM_NWNAME -e CONSUL_HOST=$CONSUL_HOST -e CONSUL_PORT=$CONSUL_PORT -e CONFIG_BINDING_SERVICE=$CONFIG_BINDING_SERVICE -e HOSTNAME=$appname --name $appname $DFC_IMAGE
+ sleep 3
+ set +x
dfc_started=false
for i in {1..10}; do
- if [ $(docker inspect --format '{{ .State.Running }}' $appname) ]
- then
- echo " Image: $(docker inspect --format '{{ .Config.Image }}' ${appname})"
- echo "DFC container ${appname} running"
- dfc_started=true
- break
- else
- sleep $i
- fi
+ if [ $(docker inspect --format '{{ .State.Running }}' $appname) ]
+ then
+ echo " Image: $(docker inspect --format '{{ .Config.Image }}' ${appname})"
+ echo "DFC container ${appname} running"
+ dfc_started=true
+ break
+ else
+ sleep $i
+ fi
done
if ! [ $dfc_started ]; then
echo "DFC container ${appname} could not be started"
@@ -410,8 +410,9 @@ __start_dfc_image() {
fi
done
- if ! [ $dfc_hb ]; then
+ if [ "$dfc_hb" = "false" ]; then
echo "DFC ${appname} did not respond to heartbeat"
+ exit 1
fi
}