CE-cms-squid 1 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>"

Stefano Belforte's avatar
Stefano Belforte committed
5
6
7
8
9
set -x
uname -a
date
set +x

Andrea Sciaba's avatar
Andrea Sciaba committed
10
11
# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
12
export SCRAM_ARCH=slc4_ia32_gcc345
Andrea Sciaba's avatar
Andrea Sciaba committed
13
14
15
16
17
18
19
20
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
    echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined"
    exit $SAME_ERROR
fi
Andrea Sciaba's avatar
Andrea Sciaba committed
21
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
Andrea Sciaba's avatar
Andrea Sciaba committed
22
echo "<pre>"
23
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
Andrea Sciaba's avatar
Andrea Sciaba committed
24
result=$?
25
cat $tmpfile
Andrea Sciaba's avatar
Andrea Sciaba committed
26
echo "</pre>"
27
28
29
grep 'Your shell is not able to find' $tmpfile > /dev/null
result2=$?
rm -f $tmpfile
Andrea Sciaba's avatar
Andrea Sciaba committed
30
31
if [ $result != 0 ]
    then
Andrea Sciaba's avatar
Andrea Sciaba committed
32
    echo "ERROR: $SW_DIR/cmsset_default.sh non existent or non readable"
Andrea Sciaba's avatar
Andrea Sciaba committed
33
34
    exit $SAME_ERROR
fi
35
36
37
38
39
if [ $result2 == 0 ]
    then
    echo "ERROR: $SW_DIR/cmsset_default.sh failed"
    exit $SAME_ERROR
fi
Andrea Sciaba's avatar
Andrea Sciaba committed
40
41

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