CE-cms-squid 1.75 KB
Newer Older
Andrea Sciaba's avatar
Andrea Sciaba committed
1
2
3
4
#!/bin/bash

echo "<h2>Test of the local FroNtier squid</h2>"

5
echo "<pre>"
Stefano Belforte's avatar
Stefano Belforte committed
6
7
8
9
set -x
uname -a
date
set +x
10
echo "</pre>"
Stefano Belforte's avatar
Stefano Belforte committed
11

Andrea Sciaba's avatar
Andrea Sciaba committed
12
13
# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
Andrea Sciaba's avatar
Andrea Sciaba committed
14
export SCRAM_ARCH=slc5_amd64_gcc462
Andrea Sciaba's avatar
Andrea Sciaba committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
if [ -n "$OSG_GRID" ] ; then
    [ -f $OSG_GRID/setup.sh ] && source $OSG_GRID/setup.sh
    echo "<p>OSG Middleware</p>"
    if [ -d $OSG_APP/cmssoft/cms ] ;then
         SW_DIR=$OSG_APP/cmssoft/cms
         echo "<p>Checking variable: \$OSG_APP/cmssoft/cms=$OSG_APP/cmssoft/cms</p>"
    elif [ -d $CVMFS/cms.cern.ch ] ; then
         SW_DIR=$CVMFS/cms.cern.ch
         echo "<p>Checking variable: \$CVMFS/cms.cern.ch=$CVMFS/cms.cern.ch</p>"
    elif [ -d /cvmfs/cms.cern.ch ] ; then
         SW_DIR=/cvmfs/cms.cern.ch
         echo "<p>Checking fallback location: /cvmfs/cms.cern.ch</p>"
    else
         echo "<p>"
         echo "Cannot find CMS software area."
         echo "</p>"
         exit $SAME_ERROR
    fi
elif [ -n "$VO_CMS_SW_DIR" ] ; then
    echo "<p>gLite Middleware</p>"
Andrea Sciaba's avatar
Andrea Sciaba committed
35
36
    SW_DIR=$VO_CMS_SW_DIR
else
37
    echo "<p>ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined</p>"
Andrea Sciaba's avatar
Andrea Sciaba committed
38
39
    exit $SAME_ERROR
fi
Andrea Sciaba's avatar
Andrea Sciaba committed
40
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
Andrea Sciaba's avatar
Andrea Sciaba committed
41
echo "<pre>"
42
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
Andrea Sciaba's avatar
Andrea Sciaba committed
43
result=$?
44
#cat $tmpfile
Andrea Sciaba's avatar
Andrea Sciaba committed
45
echo "</pre>"
46
47
48
grep 'Your shell is not able to find' $tmpfile > /dev/null
result2=$?
rm -f $tmpfile
Andrea Sciaba's avatar
Andrea Sciaba committed
49
50
if [ $result != 0 ]
    then
51
    echo "<p>ERROR: $SW_DIR/cmsset_default.sh non existent or non readable</p>"
Andrea Sciaba's avatar
Andrea Sciaba committed
52
53
    exit $SAME_ERROR
fi
54
55
if [ $result2 == 0 ]
    then
56
    echo "<p>ERROR: $SW_DIR/cmsset_default.sh failed</p>"
57
58
    exit $SAME_ERROR
fi
Andrea Sciaba's avatar
Andrea Sciaba committed
59
60

# Execute main test script
Andrea Sciaba's avatar
Andrea Sciaba committed
61
62
echo "<h3>Executing the squid test</h3>"
echo "<pre>"
63
$SAME_SENSOR_HOME/tests/test_squid.py > squid.out 2>&1
Andrea Sciaba's avatar
Andrea Sciaba committed
64
result=$?
65
cat squid.out
Andrea Sciaba's avatar
Andrea Sciaba committed
66
67
echo "</pre>"
exit $result