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

# Source the CMS environment
Andrea Sciaba's avatar
Andrea Sciaba committed
4
5
6
if [ -n "$OSG_GRID" ] ; then
    [ -f $OSG_GRID/setup.sh ] && source $OSG_GRID/setup.sh
    if [ -d $OSG_APP/cmssoft/cms ] ;then
7
	SW_DIR=$OSG_APP/cmssoft/cms
Andrea Sciaba's avatar
Andrea Sciaba committed
8
    elif [ -d $CVMFS/cms.cern.ch ] ; then
9
	SW_DIR=$CVMFS/cms.cern.ch
Andrea Sciaba's avatar
Andrea Sciaba committed
10
    elif [ -d /cvmfs/cms.cern.ch ] ; then
11
	SW_DIR=/cvmfs/cms.cern.ch
Andrea Sciaba's avatar
Andrea Sciaba committed
12
    else
13
14
15
	echo "ERROR: Cannot find CMS software in OSG node"
       	echo "summary: SW_DIR_UNDEF"
	exit $SAME_ERROR
Andrea Sciaba's avatar
Andrea Sciaba committed
16
17
    fi
elif [ -n "$VO_CMS_SW_DIR" ] ; then
Andrea Sciaba's avatar
Andrea Sciaba committed
18
19
    SW_DIR=$VO_CMS_SW_DIR
else
20
    SW_DIR=/cvmfs/cms.cern.ch
Andrea Sciaba's avatar
Andrea Sciaba committed
21
fi
Andrea Sciaba's avatar
Andrea Sciaba committed
22
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
23
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
Andrea Sciaba's avatar
Andrea Sciaba committed
24
result=$?
25
26
grep 'Your shell is not able to find' $tmpfile > /dev/null
result2=$?
27
28
29
30
31
if [ $result != 0 -o $result2 == 0 ] ; then
    cat $tmpfile
    rm -f $tmpfile
    echo "ERROR: CMS software initialisation script cmsset_default.sh failed"
    echo "summary: NO_SETUP_SCRIPT"
32
33
    exit $SAME_ERROR
fi
34
rm -f $tmpfile
Andrea Sciaba's avatar
Andrea Sciaba committed
35
36

# Execute main test script
37
$SAME_SENSOR_HOME/tests/test_squid.py > squid.out 2>&1
Andrea Sciaba's avatar
Andrea Sciaba committed
38
result=$?
39
cat squid.out
Andrea Sciaba's avatar
Andrea Sciaba committed
40
exit $result