CE-cms-squid 977 Bytes
Newer Older
Andrea Sciaba's avatar
Andrea Sciaba committed
1
2
3
4
5
6
#!/bin/bash

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

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

# Execute main test script
Andrea Sciaba's avatar
Andrea Sciaba committed
37
38
echo "<h3>Executing the squid test</h3>"
echo "<pre>"
Andrea Sciaba's avatar
Andrea Sciaba committed
39
40
41
42
$SAME_SENSOR_HOME/tests/test_squid.py 2>&1
result=$?
echo "</pre>"
exit $result