3 ################################################################################
4 # Copyright (c) 2019 AT&T Intellectual Property. #
5 # Copyright (c) 2019 Nokia. #
7 # Licensed under the Apache License, Version 2.0 (the "License"); #
8 # you may not use this file except in compliance with the License. #
9 # You may obtain a copy of the License at #
11 # http://www.apache.org/licenses/LICENSE-2.0 #
13 # Unless required by applicable law or agreed to in writing, software #
14 # distributed under the License is distributed on an "AS IS" BASIS, #
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
16 # See the License for the specific language governing permissions and #
17 # limitations under the License. #
18 ################################################################################
24 DEFAULT_LOG_LEVEL="TRACE" # Available levels: TRACE, DEBUG, INFO (default), WARN, NONE (no logging)
25 DEFAULT_RES="1280x1024x24"
27 DEFAULT_ROBOT_TEST="-i health"
29 DEFAULT_OUTPUT_FOLDER=./
31 # To mitigate the chromedriver hanging issue
32 export DBUS_SESSION_BUS_ADDRESS=/dev/null
34 # Use default if none specified as env var
35 LOG_LEVEL=${LOG_LEVEL:-$DEFAULT_LOG_LEVEL}
36 RES=${RES:-$DEFAULT_RES}
37 DISPLAY=${DISPLAY:-$DEFAULT_DISPLAY}
39 # OUTPUT_FOLDER env variable will be overridden by -d command line argument.
40 OUTPUT_FOLDER=${OUTPUT_FOLDER:-$DEFAULT_OUTPUT_FOLDER}
44 VARIABLES="--removekeywords name:keystone_interface.*"
46 ## Single argument, it is an include tag
52 ## if more than 1 tag is supplied, the must be provided with -i or -e
60 ROBOT_TAGS="${ROBOT_TAGS} -i $2"
64 ROBOT_TAGS="${ROBOT_TAGS} -e $2"
76 LISTENERS="${LISTENER} --listener $2 "
80 VARIABLEFILES="${VARIABLEFILES} -V $2 "
84 VARIABLES="${VARIABLES} -v $2 "
91 if [ "${ROBOT_TAGS}" = "" ];then
92 ROBOT_TAGS=$DEFAULT_ROBOT_TEST
96 echo -e "Starting Xvfb on display ${DISPLAY} with res ${RES}"
97 Xvfb ${DISPLAY} -ac -screen 0 ${RES} +extension RANDR &
99 # Get pid of this spawned process to make sure we kill the correct process later
101 export DISPLAY=${DISPLAY}
104 echo -e "Executing robot tests at log level ${LOG_LEVEL}"
106 ROBOT_LIBS=./robot/library:./robot/library/ricutils:./robot/library/eteutils:./robot/library/heatbridge
108 cd /var/opt/${INSTALL_NAME}
109 python -m robot.run -L ${LOG_LEVEL} -d ${OUTPUT_FOLDER} ${VARIABLEFILES} ${VARIABLES} ${LISTENERS} -P ${ROBOT_LIBS} ${ROBOT_TAGS} /var/opt/${INSTALL_NAME}/robot/testsuites/
112 # Stop Xvfb we started earlier
113 # select it from list of possible Xvfb pids running because
114 # a) there may be multiple Xvfbs running and
115 # b) the XVFBPID may not be the correct if the start did not actually work (unlikely and that may be)
119 if [ $P == $XVFBPID ];then