Commit e4313ec2 authored by Stefano Belforte's avatar Stefano Belforte
Browse files

look for middleware setup script

parent d3cf7149
#!/bin/sh
shopt -s expand_aliases
err=0
warn=0
cmsswvsn=CMSSW_2_2_13
info=0
notice=0
warning=0
error=0
isEGEE=0
isOSG=0
cat $SAME_SENSOR_HOME/tests/CMS-SAM-Banner.html
echo '<h1><a href="#summary">Jump to test summary</a></h1>'
echo "<h2>Preliminary checks</h2>"
echo "<pre>"
echo "version 23-9 17:00"
set -x
echo "version 04-03-2009 10:00"
uname -a
cat /etc/issue
date
date --utc
voms-proxy-info -identity -fqan
id
workdir=`mktemp -d workdirXXXXXX`
cd $workdir
cp -v $SAME_SENSOR_HOME/tests/cmssw_required_version_list.txt .
cp -v $SAME_SENSOR_HOME/tests/fetch-from-web .
[ -n "$GLITE_WMS_RB_BROKERINFO" ] && cp -v $GLITE_WMS_RB_BROKERINFO .
[ -n "$EDG_WL_RB_BROKERINFO" ] && cp -v $EDG_WL_RB_BROKERINFO .
echo "==========================================="
echo "===== CHECK lcg-ls ========================"
set -x
which lcg-ls
ls -l `which lcg-ls`
set +x
echo "==========================================="
echo "</pre>"
echo "<h2><a name="Analysis Test"></a>Analysis Test</h2>"
# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
export SCRAM_ARCH=slc4_ia32_gcc345
export BUILD_ARCH=slc4_ia32_gcc345
if [ -n "$OSG_APP" ] ; then
isOSG=1
SW_DIR=$OSG_APP/cmssoft/cms
echo "Checking variable: \$OSG_APP/cmssoft/cms=$OSG_APP/cmssoft/cms"
echo "</p>"
elif [ -n "$VO_CMS_SW_DIR" ] ; then
isEGEE=1
SW_DIR=$VO_CMS_SW_DIR
echo "Checking variable: \$VO_CMS_SW_DIR=$VO_CMS_SW_DIR"
echo "</p>"
else
echo "<strong>"
echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined"
exit $SAME_ERROR
fi
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
echo "<pre>"
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
result=$?
cat $tmpfile
echo "</pre>"
grep 'Your shell is not able to find' $tmpfile > /dev/null
result2=$?
rm -f $tmpfile
if [ $result != 0 ]
then
echo "ERROR: $SW_DIR/cmsset_default.sh non existent or non readable"
exit $SAME_ERROR
fi
if [ $result2 == 0 ]
then
echo "ERROR: $SW_DIR/cmsset_default.sh failed"
echo "</strong></p>"
exit $SAME_ERROR
fi
# Execute main test scripts
echo "<h3>Test analysis of data from /store/data </h3>"
echo "<pre>"
echo " SAME_SENSOR_HOME: " $SAME_SENSOR_HOME
echo "Running $SAME_SENSOR_HOME/tests/AnalysisTest.sh $cmsswvsn 2>&1"
AnalysisTestWorkDir=`mktemp -d AnalysisTestWorkDir.XXXXXXXXXX`
pushd . > /dev/null
cd $AnalysisTestWorkDir
pwd
$SAME_SENSOR_HOME/tests/AnalysisTest.sh $cmsswvsn 2>&1
result=$?
echo "AnalysisTest.sh executed with exit code " $result
echo "</pre>"
popd > /dev/null
echo
if [ $result == $SAME_WARNING ] ; then
warn=1
if [ $isEGEE == 1 ]
then
CE=`glite-brokerinfo getCE`
fi
if [ $result == $SAME_ERROR ] ; then
err=1
if [ $isOSG == 1 ]
then
CE=`grep 'name.*jobmanager' .BrokerInfo|cut -d'"' -f2`
fi
if [ -z "$CE" ] ; then
CE=$GLOBUS_CE
fi
if [ -z "$CE" ] ; then
echo "<p>WARNING: Cannot derive CE name. After attempting: <br>"
echo "<pre>"
set -x
glite-brokerinfo getCE
grep 'name.*jobmanager' .BrokerInfo|cut -d'"' -f2
echo $GLOBUS_CE
set +x
echo "</pre>"
exit $SAME_WARNING
fi
ceHost=`echo $CE|cut -d':' -f1`
ceHostWithCommas=`echo $ceHost|tr . ,`
echo "<h3>Test analysis of data from /store/user </h3>"
echo "<pre>"
echo " SAME_SENSOR_HOME: " $SAME_SENSOR_HOME
echo "Running $SAME_SENSOR_HOME/tests/AnalysisTestUser.sh $cmsswvsn 2>&1"
AnalysisTestUserWorkDir=`mktemp -d AnalysisTestUserWorkDir.XXXXXXXXXX`
pushd . > /dev/null
cd $AnalysisTestUserWorkDir
pwd
$SAME_SENSOR_HOME/tests/AnalysisTestUser.sh $cmsswvsn 2>&1
result=$?
echo "CE is: " $CE
echo "CE host is: " $ceHost
echo "</pre>"
popd > /dev/null
if [ $result != $SAME_OK ] ; then
warn=1
fi
echo "<h2>Checking a source script for middleware</h2>"
echo "<p>"
echo "RESET PATH"
echo "<pre>"
set -x
unset LD_LIBRARY_PATH
export PATH=/usr/bin:/bin
source /etc/profile &>/dev/null
set +x
echo "</pre>"
if [ $isEGEE == 1 ]; then
if [ -z $GLITE_WMS_LOCATION ]; then
echo "<h3>"
echo "ERROR: GLITE_WMS_LOCATION not defined"
echo "</h3>"
else
echo "GLITE_WMS_LOCATION =" $GLITE_WMS_LOCATION
filetosource=${GLITE_WMS_LOCATION}/etc/profile.d/grid-env.sh
if [ -x "$filetosource" ]; then
source "$filetosource" &>/dev/null
[ -x `which lcg-ls` ] && echo "<p><strong>lcg-ls found !</strong><p> as " `which lcg-ls`
fi
fi
if [ -z $GLITE_LOCATION ]; then
echo "<h3>"
echo "ERROR: GLITE_LOCATION not defined"
echo "</h3>"
else
echo "<p>GLITE_LOCATION =" $GLITE_LOCATION
filetosource=${GLITE_LOCATION}/etc/profile.d/grid-env.sh
echo "<p>try {GLITE_LOCATION}/etc/profile.d/grid-env.sh"
if [ -x "$filetosource" ]; then
source "$filetosource" &>/dev/null
[ -x `which lcg-ls` ] && echo "<p><strong>lcg-ls found ! as " `which lcg-ls` "</strong><p>"
fi
filetosource=${GLITE_LOCATION}/../etc/profile.d/grid-env.sh
echo "<p>try {GLITE_LOCATION}/../etc/profile.d/grid-env.sh"
if [ -x "$filetosource" ]; then
source "$filetosource" &>/dev/null
[ -x `which lcg-ls` ] && echo "<p><strong>lcg-ls found ! as " `which lcg-ls` "</strong><p>"
fi
fi
if [ $err == 1 ] ; then
exit $SAME_ERROR
fi
if [ $warn == 1 ] ; then
exit $SAME_WARNING
if [ $isOSG == 1 ]; then
if [ -z $OSG_GRID ]; then
echo "<h3>"
echo "ERROR: OSG_GRID not defined"
echo "</h3>"
else
echo "OSG_GRID=" $OSG_GRID
if [ -x "$OSG_GRID/setup.sh" ]; then
source "${OSG_GRID}/setup.sh" &>/dev/null
[ -x `which lcg-ls` ] && echo "<p><strong>lcg-ls found ! as " `which lcg-ls` "</strong><p>"
fi
echo "<pre>"
set -x
which lcg-ls
set +x
echo "</pre>"
fi
fi
exit $SAME_OK
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment