TEST-6 Support gather data listener 89/2289/1
authorJerry Flood <jf9860@att.com>
Wed, 22 Mar 2017 19:30:25 +0000 (15:30 -0400)
committerJerry Flood <jf9860@att.com>
Wed, 22 Mar 2017 19:30:45 +0000 (15:30 -0400)
Add gather_data_sh and support for EteDataGatherListener
into runTags.sh

Change-Id: Id161d74ac4ed90c01716d9f8f3ddfd431614f5ba
Signed-off-by: Jerry Flood <jf9860@att.com>
gather_data.sh [new file with mode: 0644]
red.xml
runTags.sh

diff --git a/gather_data.sh b/gather_data.sh
new file mode 100644 (file)
index 0000000..ad14ac3
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+##################################################################################################
+# This shell is designed to support retrieval of application debugging data in the case of
+# an ETE test failure. This script, along with the gather_application_data.sh will be installed
+# in /opt on each of the ONAP VMs. The gather_application_data function is designed by each
+# application to gather the relevant debugging data into the current working directory
+# to be zipped up and transferred to the Robot VM and ultimately, posted in the failed Jenkins
+# job.
+##################################################################################################
+
+JOB_NUMBER=$2
+APPLICATION=$1
+if [ "$JOB_NUMBER" == '' ];then
+   JOB_NUMBER=0
+fi
+if [ "$APPLICATION" == '' ];then
+   APPLICATION='job'
+fi
+
+if [ -e /opt/gather_application_data.sh ]; then
+    source /opt/gather_application_data.sh
+else
+    >&2 echo "${APPLICATION} No gather_application_data function"
+       exit
+fi
+
+
+FOLDER=/tmp/gather_data/${APPLICATION}_${JOB_NUMBER}
+mkdir -p $FOLDER
+
+cd ${FOLDER}
+
+gather_application_data
+
+cd ../
+tar --remove-files -cvzf ${APPLICATION}_${JOB_NUMBER}.tar.gz ${APPLICATION}_${JOB_NUMBER}
diff --git a/red.xml b/red.xml
index 7a8e5f9..e0d5c95 100644 (file)
--- a/red.xml
+++ b/red.xml
@@ -17,6 +17,7 @@
     <referencedLibrary type="PYTHON" name="HEATUtils" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="OSUtils" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="DNSUtils" path="testsuite/robot/library/eteutils"/>
+    <referencedLibrary type="PYTHON" name="EteListener" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="ArchiveLibrary" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="HeatBridge" path="testsuite/robot/library/heatbridge"/>
     <pythonpath>
index 29d76fc..e8a00b7 100644 (file)
@@ -20,6 +20,7 @@ DISPLAY=${DISPLAY:-$DEFAULT_DISPLAY}
 OUTPUT_FOLDER=${OUTPUT_FOLDER:-$DEFAULT_OUTPUT_FOLDER}
 
 VARIABLEFILES=
+LISTENERS=
 
 ## Single argument, it is an include tag
 if [ $# -eq 1 ]; then
@@ -46,15 +47,19 @@ do
        OUTPUT_FOLDER=$2
        shift
        ;;
-       --display)
+               --display)
        DISPLAY=:$2
        shift
        ;;
-       -V)
+               --listener)
+       LISTENERS="${LISTENER} --listener $2 "
+       shift
+       ;;
+               -V)
        VARIABLEFILES="${VARIABLEFILES} -V $2 "
        shift
        ;;
-       -v)
+               -v)
        VARIABLES="${VARIABLES} -v $2 "
        shift
        ;;
@@ -80,7 +85,7 @@ echo -e "Executing robot tests at log level ${LOG_LEVEL}"
 ROBOT_LIBS=./robot/library:./robot/library/eteutils:./robot/library/heatbridge
 
 cd /var/opt/${INSTALL_NAME}
-python -m robot.run -L ${LOG_LEVEL} -d ${OUTPUT_FOLDER} ${VARIABLEFILES} ${VARIABLES} -P ${ROBOT_LIBS} ${ROBOT_TAGS} $(pwd)
+python -m robot.run -L ${LOG_LEVEL} -d ${OUTPUT_FOLDER} ${VARIABLEFILES} ${VARIABLES} ${LISTENERS} -P ${ROBOT_LIBS} ${ROBOT_TAGS} $(pwd)
 
 # Stop Xvfb we started earlier
 # select it from list of possible Xvfb pids running because