CE-cms-analysis 2.95 KB
Newer Older
Stefano Belforte's avatar
Stefano Belforte committed
1
#!/bin/sh
Stefano Belforte's avatar
Stefano Belforte committed
2
3
shopt -s expand_aliases

4
err=0
Stefano Belforte's avatar
Stefano Belforte committed
5
6
warn=0

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

Stefano Belforte's avatar
Stefano Belforte committed
9
echo "<pre>"
Stefano Belforte's avatar
Stefano Belforte committed
10
echo "version 23-9 17:00"
Stefano Belforte's avatar
Stefano Belforte committed
11
12
13
14
15
16
17
18
19
20
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
21

Stefano Belforte's avatar
Stefano Belforte committed
22
23
# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
Stefano Belforte's avatar
Stefano Belforte committed
24
if [ -n "$OSG_APP" ] ; then
Stefano Belforte's avatar
Stefano Belforte committed
25
    SW_DIR=$OSG_APP/cmssoft/cms
Stefano Belforte's avatar
Stefano Belforte committed
26
27
elif [ -n "$VO_CMS_SW_DIR" ] ; then
    SW_DIR=$VO_CMS_SW_DIR
Stefano Belforte's avatar
Stefano Belforte committed
28
29
30
31
32
33
else
    echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined"
    exit $SAME_ERROR
fi
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
echo "<pre>"
Stefano Belforte's avatar
Stefano Belforte committed
34
35
36
37

set -x
# check for SL5
libc25=1
Stefano Belforte's avatar
Stefano Belforte committed
38
39
if ! [ -f $SW_DIR/common/cmsos ] ; then
 echo "$SW_DIR/bin/cmsos not found"
Stefano Belforte's avatar
Stefano Belforte committed
40
41
 slVersion="slc5"
else
Stefano Belforte's avatar
Stefano Belforte committed
42
 osVersion=`$SW_DIR/common/cmsos`
Stefano Belforte's avatar
Stefano Belforte committed
43
44
45
46
47
48
49
50
51
 echo "osVersion=" $osVersion
 slVersion=`echo $osVersion|cut -d'_' -f1`
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
Stefano Belforte's avatar
Stefano Belforte committed
52
 echo "<h3> op.system = " $osVersion "not an SL5 machine </h3>"
Stefano Belforte's avatar
Stefano Belforte committed
53
54
55
56
 exit $SAME_NOTICE
fi

if  [ $libc25 == "0" ] ; then
Stefano Belforte's avatar
Stefano Belforte committed
57
58
59
60
 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
61
62
63
64
 exit $SAME_INFO
fi
set +x

65
66
67
# this test requires SLC5 arch, currently
export SCRAM_ARCH=slc5_ia32_gcc434
export BUILD_ARCH=$SCRAM_ARCH
Stefano Belforte's avatar
Stefano Belforte committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
83
84
    # temporarely set this to WARNING to allow soft fail for SL4 clusters
    exit $SAME_WARNING
Stefano Belforte's avatar
Stefano Belforte committed
85
86
fi

87
# Execute main test scripts
Stefano Belforte's avatar
Stefano Belforte committed
88
echo "<h3>Test analysis of data from /store/data </h3>"
Stefano Belforte's avatar
Stefano Belforte committed
89
echo "<pre>"
90
echo " SAME_SENSOR_HOME: " $SAME_SENSOR_HOME
91
echo "Running $SAME_SENSOR_HOME/tests/AnalysisTest.sh 2>&1"
Stefano Belforte's avatar
Stefano Belforte committed
92
AnalysisTestWorkDir=`mktemp -d AnalysisTestWorkDir.XXXXXXXXXX`
93
pushd . > /dev/null
Stefano Belforte's avatar
Stefano Belforte committed
94
cd $AnalysisTestWorkDir
95
pwd
96
$SAME_SENSOR_HOME/tests/AnalysisTest.sh 2>&1
Stefano Belforte's avatar
Stefano Belforte committed
97
result=$?
98
echo "AnalysisTest.sh executed with exit code " $result
Stefano Belforte's avatar
Stefano Belforte committed
99
echo "</pre>"
100
popd > /dev/null
101
102
103
104
105

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

106
if [ $result == $SAME_ERROR ] ; then
107
108
109
  err=1
fi

110
111
112
113
114
115
116
117
118
119
120
121
#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
122

Stefano Belforte's avatar
Stefano Belforte committed
123
124
125
126
127
128

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


129

130
if [ $err == 1 ] ; then
131
    exit $SAME_WARNING
Stefano Belforte's avatar
Stefano Belforte committed
132
133
134
135
136
137
138
139
fi

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


exit $SAME_OK