Add updated setup.sh

Issue-ID:PORTAL-78
Change-Id: I4c5aa53896065365d4ad6ccd13e6e937894648e8
Signed-off-by: kishore <kk707x@att.com>
diff --git a/test/csit/plans/portal-sdk/testsuite/.env b/test/csit/plans/portal-sdk/testsuite/.env
index 1e882a0..0b7de95 100644
--- a/test/csit/plans/portal-sdk/testsuite/.env
+++ b/test/csit/plans/portal-sdk/testsuite/.env
@@ -20,3 +20,14 @@
 DOCKER_IMAGE_VERSION=1.3-STAGING-latest
 CLI_DOCKER_VERSION=1.1-STAGING-latest
 NEXUS_DOCKER_REPO=nexus3.onap.org:10003
+
+
+# Optional settings with no defaults.
+EXTRA_HOST_IP=""
+EXTRA_HOST_NAME=""
+# Export shell environment variables on hosts with no DNS;
+# a line is added to docker container's /etc/hosts.
+# For example:
+#EXTRA_HOST_IP="-i ${HOST_IP}"
+#EXTRA_HOST_NAME="-n portal.api.simpledemo.openecomp.org"
+
diff --git a/test/csit/plans/portal-sdk/testsuite/docker-compose.yml b/test/csit/plans/portal-sdk/testsuite/docker-compose.yml
index b92766f..7a9fb8c 100644
--- a/test/csit/plans/portal-sdk/testsuite/docker-compose.yml
+++ b/test/csit/plans/portal-sdk/testsuite/docker-compose.yml
@@ -91,5 +91,8 @@
       - portal-db:3306
       - --
       - /start-apps-cmd.sh
+      # see comments in .env file
+      - $EXTRA_HOST_IP
+      - $EXTRA_HOST_NAME
     logging:
       driver: json-file
diff --git a/test/csit/plans/portal-sdk/testsuite/setup.sh b/test/csit/plans/portal-sdk/testsuite/setup.sh
index 71d1105..2091d14 100644
--- a/test/csit/plans/portal-sdk/testsuite/setup.sh
+++ b/test/csit/plans/portal-sdk/testsuite/setup.sh
@@ -14,6 +14,8 @@
 HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
 export HOST_IP=${HOST_IP}
 
+
+
 if ! ifconfig docker0; then
 if ! ifconfig ens3; then
 echo "Could not determine IP address"
@@ -33,6 +35,8 @@
 export DOCKER_IP=${DOCKER_IP}
 
 
+
+
 # be verbose
 set -x
 
@@ -54,16 +58,22 @@
 rm docker-compose.yml
 cp $CURR/.env .
 cp $CURR/docker-compose.yml .
-#cd  properties_rackspace/ECOMPPORTALAPP
+#cd  properties_simpledemo/ECOMPPORTALAPP
 #rm  system.properties
 #cp  $CURR/system.properties .
 #cd ../..
 # Get image names used below from docker-compose environment file
 source $CURR/.env
+#source .env
+
+# Make inter-app communication work in CSIT
+export EXTRA_HOST_IP="-i ${HOST_IP}"
+export EXTRA_HOST_NAME="-n portal.api.simpledemo.openecomp.org"
+
 
 # Copy property files to new directory
 mkdir -p $PROPS_DIR
-cp -r properties_rackspace/* $PROPS_DIR
+cp -r properties_simpledemo/* $PROPS_DIR
 # Also create logs directory
 mkdir -p $LOGS_DIR
 
@@ -118,6 +128,8 @@
 echo "$host_entry" | sudo tee -a /etc/hosts > /dev/null
 fi
 
+
+
 sleep 3m
 
 # WAIT 5 minutes maximum and test every 5 seconds if Portal up using HealthCheck API
@@ -157,7 +169,7 @@
 HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
 export HOST_IP=${HOST_IP}
 
-docker logs deliveries_portal-db_1
+#docker logs deliveries_portal-db_1
 docker logs deliveries_portal-apps_1
 docker logs deliveries_portal-wms_1