CE-cms-analysis 3.31 KB
Newer Older
Stefano Belforte's avatar
Stefano Belforte committed
1
#!/bin/sh
2
3
4
5

# Temp change to test new version
SAME_ERROR=$SAME_INFO

Stefano Belforte's avatar
Stefano Belforte committed
6
7
shopt -s expand_aliases

8
err=0
Stefano Belforte's avatar
Stefano Belforte committed
9
10
warn=0

11
cat $SAME_SENSOR_HOME/tests/CMS-SAM-Banner.html
Stefano Belforte's avatar
Stefano Belforte committed
12

Stefano Belforte's avatar
Stefano Belforte committed
13
echo "<pre>"
Stefano Belforte's avatar
Stefano Belforte committed
14
echo "version 23-9 17:00"
Stefano Belforte's avatar
Stefano Belforte committed
15
16
17
18
19
20
21
22
23
24
set -x
uname -a
cat /etc/issue
date
date --utc
voms-proxy-info -identity -fqan
id
set +x

echo "<h2><a name="Analysis Test"></a>Analysis Test</h2>"
Stefano Belforte's avatar
Stefano Belforte committed
25

Stefano Belforte's avatar
Stefano Belforte committed
26
27
# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
Stefano Belforte's avatar
Stefano Belforte committed
28
if [ -n "$OSG_APP" ] ; then
Stefano Belforte's avatar
Stefano Belforte committed
29
    SW_DIR=$OSG_APP/cmssoft/cms
Stefano Belforte's avatar
Stefano Belforte committed
30
31
elif [ -n "$VO_CMS_SW_DIR" ] ; then
    SW_DIR=$VO_CMS_SW_DIR
Stefano Belforte's avatar
Stefano Belforte committed
32
33
34
35
else
    echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined"
    exit $SAME_ERROR
fi
Andrea Sciaba's avatar
Andrea Sciaba committed
36
37
38
39
#if [ `uname -n|cut -d. -f2-` == "cern.ch" ] ; then
#    echo "running at CERN, hardset \$SW_DIR to /afs/cern.ch/cms/sw"
#    export SW_DIR=/afs/cern.ch/cms/sw/
#fi
40
41

echo "CMS software location SW_DIR=" $SW_DIR
Stefano Belforte's avatar
Stefano Belforte committed
42
43
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
echo "<pre>"
Stefano Belforte's avatar
Stefano Belforte committed
44

45

Stefano Belforte's avatar
Stefano Belforte committed
46
47
# check for SL5
libc25=1
Stefano Belforte's avatar
Stefano Belforte committed
48
if ! [ -f $SW_DIR/common/cmsos ] ; then
49
 echo "$SW_DIR/common/cmsos not found - force to SL5"
Stefano Belforte's avatar
Stefano Belforte committed
50
51
 slVersion="slc5"
else
Stefano Belforte's avatar
Stefano Belforte committed
52
 osVersion=`$SW_DIR/common/cmsos`
53
54
55
56
 echo "osVersion  from \$SW_DIR/common/cmsos  =" $osVersion
 cmsarch=`$SW_DIR/common/cmsarch`
 echo "scram_arch from \$SW_DIR/common/cmsarch=" $cmsarch
 slVersion=`echo $cmsarch|cut -d'_' -f1`
Stefano Belforte's avatar
Stefano Belforte committed
57
58
59
60
61
62
63
fi
echo "slVersion=" $slVersion
if ! [ -f /lib/libc-2.5.so ] ; then
 echo "libc 2.5 not found, not an SL5 node"
 libc25=0
fi
if ! [ $slVersion == "slc5" ] ; then
64
 echo "<h3> not an SL5 machine </h3>"
Stefano Belforte's avatar
Stefano Belforte committed
65
66
67
68
 exit $SAME_NOTICE
fi

if  [ $libc25 == "0" ] ; then
Stefano Belforte's avatar
Stefano Belforte committed
69
70
71
72
 echo "<h2>ohibo' ! SL5 but no libc-2.5</h2>"
 echo "osVersion/slVersion =" $osVersion $slVersion
 echo "ls -l /lib/libc*"
 ls -l /lib/libc*
Stefano Belforte's avatar
Stefano Belforte committed
73
74
 exit $SAME_INFO
fi
75

Stefano Belforte's avatar
Stefano Belforte committed
76

77
78
79
# this test requires SLC5 arch, currently
export SCRAM_ARCH=slc5_ia32_gcc434
export BUILD_ARCH=$SCRAM_ARCH
Stefano Belforte's avatar
Stefano Belforte committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
result=$?
cat $tmpfile
echo "</pre>"
grep 'Your shell is not able to find' $tmpfile > /dev/null
result2=$?
rm -f $tmpfile
if [ $result != 0 ]
    then
    echo "ERROR: $SW_DIR/cmsset_default.sh non existent or non readable"
    exit $SAME_ERROR
fi
if [ $result2 == 0 ]
    then
    echo "ERROR: $SW_DIR/cmsset_default.sh failed"
Stefano Belforte's avatar
Stefano Belforte committed
95
96
    # temporarely set this to WARNING to allow soft fail for SL4 clusters
    exit $SAME_WARNING
Stefano Belforte's avatar
Stefano Belforte committed
97
98
fi

99
# Execute main test scripts
Stefano Belforte's avatar
Stefano Belforte committed
100
echo "<h3>Test analysis of data from /store/data </h3>"
Stefano Belforte's avatar
Stefano Belforte committed
101
echo "<pre>"
102
echo " SAME_SENSOR_HOME: " $SAME_SENSOR_HOME
103
echo "Running $SAME_SENSOR_HOME/tests/AnalysisTest.sh 2>&1"
Stefano Belforte's avatar
Stefano Belforte committed
104
AnalysisTestWorkDir=`mktemp -d AnalysisTestWorkDir.XXXXXXXXXX`
105
pushd . > /dev/null
Stefano Belforte's avatar
Stefano Belforte committed
106
cd $AnalysisTestWorkDir
107
pwd
108
$SAME_SENSOR_HOME/tests/AnalysisTest.sh 2>&1
Stefano Belforte's avatar
Stefano Belforte committed
109
result=$?
110
echo "AnalysisTest.sh executed with exit code " $result
Stefano Belforte's avatar
Stefano Belforte committed
111
echo "</pre>"
112
popd > /dev/null
113
114
115
116
117

if [ $result == $SAME_WARNING ] ; then
  warn=1
fi

118
if [ $result == $SAME_ERROR ] ; then
119
120
121
  err=1
fi

122
123
124
125
126
127
128
129
130
131
132
133
#echo "<h3>Test analysis of data from /store/user </h3>"
#echo "<pre>"
#echo " SAME_SENSOR_HOME: " $SAME_SENSOR_HOME
#echo "Running $SAME_SENSOR_HOME/tests/AnalysisTestUser.sh 2>&1"
#AnalysisTestUserWorkDir=`mktemp -d AnalysisTestUserWorkDir.XXXXXXXXXX`
#pushd . > /dev/null
#cd $AnalysisTestUserWorkDir
#pwd
#$SAME_SENSOR_HOME/tests/AnalysisTestUser.sh 2>&1
#result=$?
#echo "</pre>"
#popd > /dev/null
134

Stefano Belforte's avatar
Stefano Belforte committed
135
136
137
138
139
140

if [ $result != $SAME_OK ] ; then
  warn=1
fi


141

142
if [ $err == 1 ] ; then
143
    exit $SAME_ERROR
Stefano Belforte's avatar
Stefano Belforte committed
144
145
146
147
148
149
150
151
fi

if [ $warn == 1 ] ; then
    exit $SAME_WARNING
fi


exit $SAME_OK