aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/scripts/sdc
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-01-19 02:29:22 +0000
committerGerrit Code Review <gerrit@onap.org>2018-01-19 02:29:22 +0000
commite60d218d8a9ca0700e4b1d117ddf7b59fa18194a (patch)
treeee4a5a69c81deb6e1386e8a0fbd86050495a192d /test/csit/scripts/sdc
parent60dd0d84290b33e00fd5d4a05367670e8d5b4d6f (diff)
parenta2d8b3bf42f2ea4f82790e0c86d2ce744657310c (diff)
Merge "Add branch support for sdc csit"
Diffstat (limited to 'test/csit/scripts/sdc')
-rw-r--r--test/csit/scripts/sdc/clone_and_setup_sdc_data.sh49
-rw-r--r--test/csit/scripts/sdc/docker_health.sh8
-rw-r--r--test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh8
-rw-r--r--test/csit/scripts/sdc/start_sdc_containers.sh4
4 files changed, 63 insertions, 6 deletions
diff --git a/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh b/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh
index 5dbfb5fc2..1025f405d 100644
--- a/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh
+++ b/test/csit/scripts/sdc/clone_and_setup_sdc_data.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+
+
+set -x
#
# ============LICENSE_START=======================================================
# ONAP CLAMP
@@ -61,4 +64,50 @@ export HOST_IP=$IP_ADDRESS
sed -i "s/\"ueb_url_list\":.*/\"ueb_url_list\": \""$MR_IP_ADDR","$MR_IP_ADDR"\",/g" ${WORKSPACE}/data/environments/$ENV_NAME.json
sed -i "s/\"fqdn\":.*/\"fqdn\": [\""$MR_IP_ADDR"\", \""$MR_IP_ADDR"\"]/g" ${WORKSPACE}/data/environments/$ENV_NAME.json
+
+source ${WORKSPACE}/data/clone/sdc/version.properties
+export RELEASE=$major.$minor-STAGING-latest
+export DEP_ENV=$ENV_NAME
+
+cp ${WORKSPACE}/data/clone/sdc/sdc-os-chef/scripts/docker_run.sh ${WORKSPACE}/test/csit/scripts/sdc/
+#sed -i "s~/data~${WORKSPACE}\/data~g" ${WORKSPACE}/test/csit/scripts/sdc/docker_run.sh
+#sed -i "s/HOST_IP=\${IP}/HOST_IP=\${HOST_IP}/g" ${WORKSPACE}/test/csit/scripts/sdc/docker_run.sh
+sed -i "s/ENVNAME=\"\${DEP_ENV}\"/ENVNAME=\"\${ENV_NAME}\"/g" ${WORKSPACE}/test/csit/scripts/sdc/docker_run.sh
+
+source ${WORKSPACE}/data/clone/sdc/version.properties
+export RELEASE=$major.$minor-STAGING-latest
+
+
+bash -x ${WORKSPACE}/test/csit/scripts/sdc/docker_run.sh -r ${RELEASE} -p 10001 -t
+
+sleep 120
+
+#monitor sanity process
+
+TIME_OUT=1200
+INTERVAL=20
+TIME=0
+while [ "$TIME" -lt "$TIME_OUT" ]; do
+
+PID=`docker exec -i sdc-sanity ps -ef | grep java | awk '{print $2}'`
+echo sanity PID is -- $PID
+
+if [ -z "$PID" ]
+ then
+ echo SDC sanity finished in $TIME seconds
+ break
+ fi
+
+ echo Sleep: $INTERVAL seconds before testing if SDC sanity completed. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds
+ sleep $INTERVAL
+ TIME=$(($TIME+$INTERVAL))
+done
+
+if [ "$TIME" -ge "$TIME_OUT" ]
+ then
+ echo TIME OUT: Sany was NOT completed in $TIME_OUT seconds... Could cause problems for tests...
+fi
+
+
+
diff --git a/test/csit/scripts/sdc/docker_health.sh b/test/csit/scripts/sdc/docker_health.sh
index 832b25a23..4264b1a59 100644
--- a/test/csit/scripts/sdc/docker_health.sh
+++ b/test/csit/scripts/sdc/docker_health.sh
@@ -13,11 +13,11 @@ curl http://localhost:8181/sdc1/rest/healthCheck
echo ""
echo ""
-res=`curl -s -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "USER_ID: jh0003" "http://localhost:8080/sdc2/rest/v1/user/demo" | wc -l`
-if [[ ${res} != 0 ]]
+http_code=$(curl -o out.html -w '%{http_code}' -H "Accept: application/json" -H "Content-Type: application/json" -H "USER_ID: jh0003" http://localhost:8080/sdc2/rest/v1/user/demo;)
+if [[ ${http_code} != 200 ]]
then
- echo "Error [${res}] while user existance check"
- exit ${res}
+ echo "Error [${http_code}] while user existance check"
+ return ${http_code}
fi
echo "check user existance: OK"
diff --git a/test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh b/test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh
index 48a31e895..efa372ed2 100644
--- a/test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh
+++ b/test/csit/scripts/sdc/kill_containers_and_remove_dataFolders.sh
@@ -19,6 +19,14 @@
echo "This is ${WORKSPACE}/test/csit/scripts/sdc/kill_and_remove_dataFolder.sh"
+# copy logs to archive
+
+cp -rf ${WORKSPACE}/data/logs/sdc-sanity/ExtentReport/* ${WORKSPACE}/archives/
+cp -rf ${WORKSPACE}/data/logs/ ${WORKSPACE}/archives/
+cp -rf ${WORKSPACE}/data/logs/sdc-sanity/target/*.xml ${WORKSPACE}/archives/
+
+ls -Rt ${WORKSPACE}/archives/
+
#kill and remove all sdc dockers
docker stop $(docker ps -a -q --filter="name=sdc")
docker rm $(docker ps -a -q --filter="name=sdc")
diff --git a/test/csit/scripts/sdc/start_sdc_containers.sh b/test/csit/scripts/sdc/start_sdc_containers.sh
index 0dd373256..5bc8770bf 100644
--- a/test/csit/scripts/sdc/start_sdc_containers.sh
+++ b/test/csit/scripts/sdc/start_sdc_containers.sh
@@ -24,8 +24,8 @@
echo "This is ${WORKSPACE}/test/csit/scripts/sdc/start_sdc_containers.sh"
-
-export RELEASE='1.1-STAGING-latest'
+source ${WORKSPACE}/data/clone/sdc/version.properties
+export RELEASE=$major.$minor-STAGING-latest
export DEP_ENV=$ENV_NAME
#[ -f /opt/config/nexus_username.txt ] && NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) || NEXUS_USERNAME=release
#[ -f /opt/config/nexus_password.txt ] && NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) || NEXUS_PASSWD=sfWU3DFVdBr7GVxB85mTYgAW