CE-cms-squid 1.08 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_ia32_gcc434
Andrea Sciaba's avatar
Andrea Sciaba committed
15
16
17
18
19
if [ -n "$VO_CMS_SW_DIR" ] ; then
    SW_DIR=$VO_CMS_SW_DIR
elif [ -n "$OSG_APP" ] ; then
    SW_DIR=$OSG_APP/cmssoft/cms
else
20
    echo "<p>ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined</p>"
Andrea Sciaba's avatar
Andrea Sciaba committed
21
22
    exit $SAME_ERROR
fi
Andrea Sciaba's avatar
Andrea Sciaba committed
23
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
Andrea Sciaba's avatar
Andrea Sciaba committed
24
echo "<pre>"
25
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
Andrea Sciaba's avatar
Andrea Sciaba committed
26
result=$?
27
#cat $tmpfile
Andrea Sciaba's avatar
Andrea Sciaba committed
28
echo "</pre>"
29
30
31
grep 'Your shell is not able to find' $tmpfile > /dev/null
result2=$?
rm -f $tmpfile
Andrea Sciaba's avatar
Andrea Sciaba committed
32
33
if [ $result != 0 ]
    then
34
    echo "<p>ERROR: $SW_DIR/cmsset_default.sh non existent or non readable</p>"
Andrea Sciaba's avatar
Andrea Sciaba committed
35
36
    exit $SAME_ERROR
fi
37
38
if [ $result2 == 0 ]
    then
39
    echo "<p>ERROR: $SW_DIR/cmsset_default.sh failed</p>"
40
41
    exit $SAME_ERROR
fi
Andrea Sciaba's avatar
Andrea Sciaba committed
42
43

# Execute main test script
Andrea Sciaba's avatar
Andrea Sciaba committed
44
45
echo "<h3>Executing the squid test</h3>"
echo "<pre>"
46
$SAME_SENSOR_HOME/tests/test_squid.py > squid.out 2>&1
Andrea Sciaba's avatar
Andrea Sciaba committed
47
result=$?
48
cat squid.out
Andrea Sciaba's avatar
Andrea Sciaba committed
49
50
echo "</pre>"
exit $result