blob: ad14ac3368c0d0c429e41c5f88fa9427fef67235 [file] [log] [blame]
Jerry Flood4345ded2017-03-22 15:30:25 -04001#!/bin/bash
2##################################################################################################
3# This shell is designed to support retrieval of application debugging data in the case of
4# an ETE test failure. This script, along with the gather_application_data.sh will be installed
5# in /opt on each of the ONAP VMs. The gather_application_data function is designed by each
6# application to gather the relevant debugging data into the current working directory
7# to be zipped up and transferred to the Robot VM and ultimately, posted in the failed Jenkins
8# job.
9##################################################################################################
10
11JOB_NUMBER=$2
12APPLICATION=$1
13if [ "$JOB_NUMBER" == '' ];then
14 JOB_NUMBER=0
15fi
16if [ "$APPLICATION" == '' ];then
17 APPLICATION='job'
18fi
19
20if [ -e /opt/gather_application_data.sh ]; then
21 source /opt/gather_application_data.sh
22else
23 >&2 echo "${APPLICATION} No gather_application_data function"
24 exit
25fi
26
27
28FOLDER=/tmp/gather_data/${APPLICATION}_${JOB_NUMBER}
29mkdir -p $FOLDER
30
31cd ${FOLDER}
32
33gather_application_data
34
35cd ../
36tar --remove-files -cvzf ${APPLICATION}_${JOB_NUMBER}.tar.gz ${APPLICATION}_${JOB_NUMBER}