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

4
5
err=0
warn=0
6
7
8
9

cat $SAME_SENSOR_HOME/tests/CMS-SAM-Banner.html

echo "<pre>"
10
11
echo "version 23-9 17:00"
set -x
12
13
14
15
16
17
uname -a
cat /etc/issue
date
date --utc
voms-proxy-info -identity -fqan
id
18
set +x
19

20
21
22
23
24
echo "<h2><a name="Analysis Test"></a>Analysis Test</h2>"
# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
export SCRAM_ARCH=slc4_ia32_gcc345
export BUILD_ARCH=slc4_ia32_gcc345
25
26
27
28
29
30
31
if [ -n "$OSG_APP" ] ; then
    SW_DIR=$OSG_APP/cmssoft/cms
elif [ -n "$VO_CMS_SW_DIR" ] ; then
    SW_DIR=$VO_CMS_SW_DIR
else
    echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined"
    exit $SAME_ERROR
32
fi
33
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
34
echo "<pre>"
35
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
36
result=$?
37
cat $tmpfile
38
echo "</pre>"
39
40
41
grep 'Your shell is not able to find' $tmpfile > /dev/null
result2=$?
rm -f $tmpfile
42
43
if [ $result != 0 ]
    then
44
    echo "ERROR: $SW_DIR/cmsset_default.sh non existent or non readable"
45
    exit $SAME_ERROR
46
fi
47
48
49
if [ $result2 == 0 ]
    then
    echo "ERROR: $SW_DIR/cmsset_default.sh failed"
50
    exit $SAME_ERROR
51
52
fi

53
54
# Execute main test scripts
echo "<h3>Test analysis of data from /store/data </h3>"
55
echo "<pre>"
56
57
58
59
60
61
62
63
64
echo " SAME_SENSOR_HOME: " $SAME_SENSOR_HOME
echo "Running $SAME_SENSOR_HOME/tests/AnalysisTest.sh 2>&1"
AnalysisTestWorkDir=`mktemp -d AnalysisTestWorkDir.XXXXXXXXXX`
pushd . > /dev/null
cd $AnalysisTestWorkDir
pwd
$SAME_SENSOR_HOME/tests/Test-AnalysisTest.sh 2>&1
result=$?
echo "AnalysisTest.sh executed with exit code " $result
65
echo "</pre>"
66
popd > /dev/null
67

68
69
if [ $result == $SAME_WARNING ] ; then
  warn=1
70
71
fi

72
73
if [ $result == $SAME_ERROR ] ; then
  err=1
74
75
fi

76
echo "<h3>Test analysis of data from /store/user </h3>"
77
echo "<pre>"
78
79
80
81
82
83
84
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/Test-AnalysisTestUser.sh 2>&1
85
86
result=$?
echo "</pre>"
87
popd > /dev/null
88
89


90
91
if [ $result != $SAME_OK ] ; then
  warn=1
92
93
94
95
fi



96
97
if [ $err == 1 ] ; then
    exit $SAME_ERROR
98
99
fi

100
101
if [ $warn == 1 ] ; then
    exit $SAME_WARNING
102
103
104
fi


Stefano Belforte's avatar
Stefano Belforte committed
105
exit $SAME_OK