]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGPP/CalibMacros/CPass1/validation.sh
mergeMakeOCDB.byComponent.sh:
[u/mrichter/AliRoot.git] / PWGPP / CalibMacros / CPass1 / validation.sh
CommitLineData
5cebce24 1#!/bin/bash
2
3FILESTOCHECK="rec_Barrel.log rec_Outer.log calib.log AliESDs_Barrel.root AliESDfriends_v1.root"
4
a45764d9 5validateout=`dirname $0`
a45764d9 6
5cebce24 7if [ -z "$validateout" ]; then
a45764d9 8 validateout="."
9fi
5cebce24 10
11cd "$validateout"
12validateworkdir=`pwd`
13
14(
15echo "* *****************************************************"
16echo "* AliRoot Validation Script V2.0 *"
17echo "* Time: `date`"
18echo "* Dir: $validateout"
19echo "* Workdir: $validateworkdir"
20echo "* ----------------------------------------------------*"
21
22for subdir in . Barrel OuterDet; do
23 if [ -d "$subdir" ]; then
24 echo "Listing $subdir"
25 ls -lA "$subdir/"
26 echo ""
27 fi
28done
29
30echo "* ----------------------------------------------------*"
31) >> stdout
32
33if [ -f OCDB.generating.job ]; then
34 echo "* This was a special OCDB.root job for which I'll skip the rest of the validation" >> stdout
35
36 mv stdout stdout.ocdb.log 2>/dev/null
37 mv stderr stderr.ocdb.log 2>/dev/null
38 mv rec.log stdrec.ocdb.log 2>/dev/null
39
40 if [ -f OCDB.root ]; then
41 echo "* ODCB.root found" >> stdout.ocdb.log
42 exit 0
43 else
44 echo "* Error: OCDB.root NOT found! Failing validation" >> stdout.ocdb.log
45 exit 1
a45764d9 46 fi
47fi
5cebce24 48
49error=0
50
51for file in $FILESTOCHECK; do
52 if [ ! -f "$file" ]; then
53 error=1
54 echo "* Error: Required file $file not found in the output" >> stdout
55 fi
56done
57
58for message in "std::bad_alloc" "Segmentation violation" "Segmentation fault" "Bus error" "Break" "Floating point exception" "Killed" "busy flag cleared"; do
59 found=`grep -i -n -m 1 "$message" *.log`
60 if [ ! -z "$found" ]; then
61 (
62 echo "* Found error message '$message' in the logs:"
63 echo "$found"
64 echo ""
65 ) >> stdout
66
67 error=2
68 fi
69done
70
71(
72if [ $error -eq 0 ]; then
73 echo "* ################ Job validated ####################"
a45764d9 74else
5cebce24 75 echo "* ################ Job NOT validated, error code $error ################"
76# echo "* ########## Removing all ROOT files from the local directory, leaving only the logs ###"
77# rm -rf *.root
a45764d9 78fi
5cebce24 79) >> stdout
80
81mv stdout stdout.log
82mv stderr stderr.log
83
a45764d9 84exit $error