aboutsummaryrefslogtreecommitdiffstats
path: root/runEteTag.sh
blob: 7d4b0ec8d3545f986df9491388b33864b84efa38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: 
#!/bin/bash
INSTALL_DIR=/var/opt/ONAP

#####################################################################
# Start display on 256 if it has not already been started...
# This will stay up and be used for all soak tests
# Tried this once and got an unexpected error so restored the start/kill
# pattern for each test for now.
# Perhaps the error was unrelated to the using the same display for 
# all tests. Preserve this just in case....
function start_display_if
{
	export DISPLAY=:256
    xdpyinfo -display $DISPLAY >/dev/null 2>&1
    while [ $? = 1 ]
    do
		# Start Xvfb
		echo -e "Starting Xvfb on display ${DISPLAY} with res ${RES}"
		Xvfb ${DISPLAY} -ac -screen 0 ${RES} +extension RANDR &
		disown
    done
}

#####################################################################
function start_display
{
	export DISPLAY=:$(( $TEST_NUMBER % 256 ))
    xdpyinfo -display $DISPLAY >/dev/null 2>&1
    while [ $? = 0 ]
    do
	   DISPLAY=$(( $RANDOM % 1000 ))
       xdpyinfo -display $DISPLAY >/dev/null 2>&1
    done
	# Start Xvfb
	echo -e "Starting Xvfb on display ${DISPLAY} with res ${RES}"
	Xvfb ${DISPLAY} -ac -screen 0 ${RES} +extension RANDR &
	XVFBPID=$!
	disown
	echo ${DISPLAY} > /tmp/robotDisplay.$TEST_NUMBER
	# Get and save pid of this spawned process to make sure we kill the correct process later
}

#####################################################################
function kill_display
{
    xdpyinfo -display $DISPLAY >/dev/null 2>&1
    if [ $? = 0 ]; then
       kill -9 $XVFBPID >/dev/null 2>&1
    fi
    rm -rf   /tmp/robotDisplay.$TEST_NUMBER
}

#####################################################################
# main
#####################################################################
export ROBOT_TAG=$1
export TEST_NUMBER=$2

if [ "$TEST_NUMBER" = "" ];then
    TEST_NUMBER=$$
fi

# Use default if none specified as env var
DEFAULT_LOG_LEVEL="INFO" # Available levels: TRACE, DEBUG, INFO (default), WARN, NONE (no logging)
LOG_LEVEL=${LOG_LEVEL:-$DEFAULT_LOG_LEVEL}

# To mitigate the chromedriver hanging issue
export DBUS_SESSION_BUS_ADDRESS=/dev/null

RES="1280x1024x24"
OUTPUT_FOLDER=/share/logs/${SOAKSUBFOLDER}runEteTag_$TEST_NUMBER
mkdir -p $OUTPUT_FOLDER
INSTALL_DIR="/var/opt/ONAP"

ROBOT_LIBS=./robot/library:./robot/library/ONAPLibrary:./robot/library/heatbridge
VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py"
VARIABLES="-v GLOBAL_BUILD_NUMBER:$TEST_NUMBER"
LISTENERS=

start_display

# Execute tests
echo -e "Executing robot test ${ROBOT_TAG} at log level ${LOG_LEVEL}"

cd ${INSTALL_DIR}
python -m robot.run -L ${LOG_LEVEL} -d ${OUTPUT_FOLDER} ${VARIABLEFILES} ${VARIABLES} ${LISTENERS} -P ${ROBOT_LIBS} -i ${ROBOT_TAG} $(pwd) > ${OUTPUT_FOLDER}/robot.out 2>&1

####################################################################
# Stop Xvfb we started earlier
kill_display