Stone, Avi (as206k) | eaf5706 | 2018-04-12 15:57:26 +0300 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | function help_usage () |
| 4 | { |
| 5 | echo |
| 6 | echo "$0 (<jar_file_name> <suite file name>)" |
| 7 | echo |
| 8 | exit 2 |
| 9 | } |
| 10 | |
| 11 | function isBoolean () |
| 12 | { |
| 13 | PARAM_NAME=$1 |
| 14 | VALUE=$2 |
| 15 | if [[ ${VALUE} != "true" ]] && [[ ${VALUE} != "false" ]]; then |
| 16 | echo "Valid parameter" ${PARAM_NAME} "values are: true/false" |
| 17 | help_usage |
| 18 | fi |
| 19 | } |
| 20 | |
| 21 | #main |
| 22 | [ $# -lt 2 ] && help_usage |
| 23 | |
| 24 | JAR_FILE=$1 |
| 25 | SUITE_FILE=$2 |
| 26 | |
| 27 | CURRENT_DIR=`pwd` |
| 28 | BASEDIR=$(dirname $0) |
| 29 | if [ ${BASEDIR:0:1} = "/" ] |
| 30 | then |
| 31 | FULL_PATH=$BASEDIR |
| 32 | else |
| 33 | FULL_PATH=$CURRENT_DIR/$BASEDIR |
| 34 | fi |
| 35 | LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties |
| 36 | CONF_FILE=${FULL_PATH}/conf/conf.yaml |
| 37 | CREDENTIALS_FILE=${FULL_PATH}/conf/credentials.yaml |
Stone, Avi (as206k) | 7db40ac | 2018-05-21 14:57:57 +0300 | [diff] [blame] | 38 | MainClass=org.onap.dcae.ci.run.RunTestSuite |
Stone, Avi (as206k) | eaf5706 | 2018-04-12 15:57:26 +0300 | [diff] [blame] | 39 | |
| 40 | |
| 41 | cmd="java -Dconfig.resource=${CONF_FILE} -Dcredentials.file=${CREDENTIALS_FILE} -Dlog4j.configuration=${LOGS_PROP_FILE} -DtestSuite=${SUITE_FILE} -cp $JAR_FILE ${MainClass} &" |
| 42 | $cmd |
| 43 | |
| 44 | status=`echo $?` |
| 45 | |
| 46 | echo "##################################################" |
| 47 | echo "################# status is ${status} #################" |
| 48 | echo "##################################################" |
| 49 | |
| 50 | exit $status |