]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/muondep/QAMergeTemplates/validation.sh
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / muondep / QAMergeTemplates / validation.sh
CommitLineData
81190958 1#!/bin/bash
2
3##################################################
4validateout=`dirname $0`
5validatetime=`date`
6validated="0";
7error=0
8if [ -z $validateout ]
9then
10validateout="."
11fi
12
13cd $validateout;
14validateworkdir=`pwd`;
15
16echo "*******************************************************" >> stdout
17echo "* Automatically generated validation script *" >> stdout
18
19echo "* Time: $validatetime " >> stdout
20echo "* Dir: $validateout" >> stdout
21echo "* Workdir: $validateworkdir" >> stdout
22echo "* ----------------------------------------------------*" >> stdout
23ls -la ./ >> stdout
24echo "* ----------------------------------------------------*" >> stdout
25
26##################################################
27
28if [ ! -f stderr ] ; then
29error=1
30echo "* ########## Job not validated - no stderr ###" >> stdout
31echo "Error = $error" >> stdout
32fi
33parArch=`grep -Ei "Cannot Build the PAR Archive" stderr`
34segViol=`grep -Ei "Segmentation violation" stderr`
35segFault=`grep -Ei "Segmentation fault" stderr`
36glibcErr=`grep -Ei "*** glibc detected ***" stderr`
37
38if [ "$parArch" != "" ] ; then
39error=1
40echo "* ########## Job not validated - PAR archive not built ###" >> stdout
41echo "$parArch" >> stdout
42echo "Error = $error" >> stdout
43fi
44if [ "$segViol" != "" ] ; then
45error=1
46echo "* ########## Job not validated - Segment. violation ###" >> stdout
47echo "$segViol" >> stdout
48echo "Error = $error" >> stdout
49fi
50if [ "$segFault" != "" ] ; then
51error=1
52echo "* ########## Job not validated - Segment. fault ###" >> stdout
53echo "$segFault" >> stdout
54echo "Error = $error" >> stdout
55fi
56if [ "$glibcErr" != "" ] ; then
57error=1
58echo "* ########## Job not validated - *** glibc detected *** ###" >> stdout
59echo "$glibcErr" >> stdout
60echo "Error = $error" >> stdout
61fi
62# Only check all desired files have been merged properly.
63# Skip the validation by the analysis manager after the Terminate
64# since all the output files have not been registered at the
65# previous stage (like EventStat_temp.root or pyxsec_hists.root)
66# and the manager will complain about...
67if ! [ -f outputs_valid_merge ] ; then
68error=1
69echo "Output files were not validated by the analysis manager" >> stdout
70echo "Output files were not validated by the analysis manager" >> stderr
71fi
72if [ $error = 0 ] ; then
73echo "* ---------------- Job Validated ------------------*" >> stdout
74# echo "* === Logs std* will be deleted === "
75# rm -f std*
76fi
77echo "* ----------------------------------------------------*"
78echo "*******************************************************"
79cd -
80exit $error