aboutsummaryrefslogtreecommitdiffstats
path: root/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh')
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh147
1 files changed, 0 insertions, 147 deletions
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh
deleted file mode 100644
index d16d05400f..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/bash
-REMOTE_DEBUG=false
-RERUN=false
-debug_port=8000
-TEST_SUITES=testSuites
-fileName=testng-failed.xml
-JAVA_OPTIONS="${JAVA_OPTIONS} \
- -Djavax.net.ssl.trustStore=/var/lib/tests/etc/org.onap.sdc.trust.jks \
- -Dtestng.show.stack.frames=true \
- "
-
-function help_usage ()
-{
- echo
- echo "$0 (<jar_file_name> <suite file name>) [-r/rerun <true/false> -d/debug <true/false>]"
- echo "nohup ./startTest.sh ui-ci-1707.0.5-SNAPSHOT-jar-with-dependencies.jar extendedSanity.xml -r false -d true &"
- echo "by default rerun is true and remote debug is false."
- echo
- exit 2
-}
-
-function isBoolean ()
-{
- PARAM_NAME=$1
- VALUE=$2
- if [[ ${VALUE} != "true" ]] && [[ ${VALUE} != "false" ]]; then
- echo "Valid parameter" ${PARAM_NAME} "values are: true/false"
- help_usage
- fi
-}
-
-function prepareFailedXmlFile ()
-{
- echo "1="$1 "2="$2 "fileName="${fileName}
- PATTERN=`grep -w "test name=" ${FULL_PATH}/${TEST_SUITES}/$2 | awk -F'"' '{print $2}'`
- sed '/<test name="'${PATTERN}'"/,/<!-- '${PATTERN}' --/d' $1 > ${FULL_PATH}/${TEST_SUITES}/${fileName}
- sed -i 's/thread-count="[0-9]\+"/thread-count="1"/g' ${FULL_PATH}/${TEST_SUITES}/${fileName}
- if [ -s "ExtentReport/ShortReport.csv" ]
- then
- SKIP_TESTS_LIST=$(cat ExtentReport/ShortReport.csv |awk -F, '{print $2}' | sed 's/&.*//g' | uniq)
- for SKIP_TEST in ${SKIP_TESTS_LIST}; do
- sed -i "s/.*\"${SKIP_TEST}\".*//g" ${FULL_PATH}/${TEST_SUITES}/${fileName};
- done;
- fi
-}
-
-function setUpdatedTimeToReport ()
-{
- LINE_NUMBER_OF_START_REPORT_DATE=`grep -A1 -nw "Start" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
- END_REPORT_DATE=`grep -A1 -nw "End" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk -F'[>|<]' '{print $3}'`
- EPOCH_START_REPORT_DATE=`date --date="${1}" +%s`
- EPOCH_END_REPORT_DATE=`date --date="${END_REPORT_DATE}" +%s`
- let DIFF_EPOCH_TIME=${EPOCH_END_REPORT_DATE}-${EPOCH_START_REPORT_DATE}
- TAKEN_TIME_IN_MINUTES=`echo $((${DIFF_EPOCH_TIME}/60))`
- LINE_NUMBER_OF_TAKEN_REPORT_TIME=`grep -A1 -nw "Time Taken" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
- PATTERN="div class='panel-lead'>";
- sed -i "${LINE_NUMBER_OF_START_REPORT_DATE}s/${PATTERN}.*\</${PATTERN}$1\<\//1" ExtentReport/SDC_UI_Extent_Report.html
- sed -i "${LINE_NUMBER_OF_TAKEN_REPORT_TIME}s/${PATTERN}.*\</${PATTERN}${TAKEN_TIME_IN_MINUTES} min\<\//1" ExtentReport/SDC_UI_Extent_Report.html
-}
-
-#main
-[ $# -lt 2 ] && help_usage
-
-JAR_FILE=$1
-SUITE_FILE=$2
-
-while [ $# -ne 0 ]; do
- case $1 in
- -r|rerun)
- RERUN=$2
- isBoolean $1 ${RERUN}
- shift 1
- shift 1
- ;;
- -d|debug)
- REMOTE_DEBUG=$2
- isBoolean $1 ${REMOTE_DEBUG}
- shift 1
- shift 1
- ;;
- *)
- shift 1
- ;;
- esac
-done
-
-CURRENT_DIR=`pwd`
-BASEDIR=$(dirname $0)
-
-if [ ${BASEDIR:0:1} = "/" ]
-then
- FULL_PATH=$BASEDIR
-else
- FULL_PATH=$CURRENT_DIR/$BASEDIR
-fi
-LOGS_PROP_FILE=conf/log4j2.properties
-#############################################
-TARGET_DIR=${FULL_PATH}/target
-CONF_FILE=${FULL_PATH}/conf/sdc.yaml
-
-DEBUG=true
-MainClass=org.openecomp.sdc.ci.tests.run.StartTest
-
-TESTS_DIR=/opt/app/sdc/ci/resources/tests
-COMPONENTS_DIR=/opt/app/sdc/ci/resources/components
-
-
-TARGET_LOG_DIR="${TARGET_DIR}/"
-
-
-
-
-
-
-if [ ${REMOTE_DEBUG} == "true" ]; then
- echo "Debug mode, Listen on port $debug_port";
- JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ;
-fi
-
-cmd="java $JAVA_OPTIONS -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
-
-
-if [ $DEBUG == "true" ]
-then
- $cmd
-else
- $cmd >> /dev/null
-fi
-
-if [ ${RERUN} == "true" ]; then
- if [ -f ${TARGET_DIR}/${fileName} ]; then
- echo "Prepare" ${TARGET_DIR}/${fileName} "file to rerun all failed tests ...";
- prepareFailedXmlFile ${TARGET_DIR}/${fileName} $SUITE_FILE;
- SUITE_FILE=${fileName};
- cmd="java $JAVA_OPTIONS -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
- $cmd;
- fi
-fi
-
-status=`echo $?`
-
-
-echo "##################################################"
-echo "################# status is ${status} #################"
-echo "##################################################"
-
-exit $status