summaryrefslogtreecommitdiffstats
path: root/src/main/resources/scripts/run.sh
blob: 158f49704b704c26ae2b074a68f90a9d73225306 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash

function help_usage ()
{
	echo
	echo "$0 (<jar_file_name> <suite file name>)"
	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	
}

#main
[ $# -lt 2 ] && help_usage

JAR_FILE=$1
SUITE_FILE=$2

CURRENT_DIR=`pwd`
BASEDIR=$(dirname $0)
if [ ${BASEDIR:0:1} = "/" ]
then
        FULL_PATH=$BASEDIR
else
        FULL_PATH=$CURRENT_DIR/$BASEDIR
fi
LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties
CONF_FILE=${FULL_PATH}/conf/conf.yaml
CREDENTIALS_FILE=${FULL_PATH}/conf/credentials.yaml
MainClass=org.onap.dcae.ci.run.RunTestSuite


cmd="java -Dconfig.resource=${CONF_FILE} -Dcredentials.file=${CREDENTIALS_FILE} -Dlog4j.configuration=${LOGS_PROP_FILE} -DtestSuite=${SUITE_FILE} -cp $JAR_FILE ${MainClass} &"
$cmd

status=`echo $?`

echo "##################################################"
echo "################# status is ${status} #################" 
echo "##################################################"

exit $status