Commit 288ab807 authored by Andrea Sciaba's avatar Andrea Sciaba
Browse files

HTML-free version

parent 4bda3098
#!/bin/bash
echo "<h2>Stage out test for the Monte Carlo production</h2>"
echo "<h3>Preliminary checks</h3>"
echo "<pre>"
set -x
uname -a
date
id
#env | grep -v '^NAGIOS'
set +x
echo "</pre>"
# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
export SCRAM_ARCH=slc5_amd64_gcc462
if [ -n "$OSG_GRID" ] ; then
[ -f $OSG_GRID/setup.sh ] && source $OSG_GRID/setup.sh
echo "<p>OSG Middleware</p>"
if [ -d $OSG_APP/cmssoft/cms ] ;then
SW_DIR=$OSG_APP/cmssoft/cms
echo "<p>Checking variable: \$OSG_APP/cmssoft/cms=$OSG_APP/cmssoft/cms</p>"
elif [ -d $CVMFS/cms.cern.ch ] ; then
SW_DIR=$CVMFS/cms.cern.ch
echo "<p>Checking variable: \$CVMFS/cms.cern.ch=$CVMFS/cms.cern.ch</p>"
elif [ -d /cvmfs/cms.cern.ch ] ; then
SW_DIR=/cvmfs/cms.cern.ch
echo "<p>Checking fallback location: /cvmfs/cms.cern.ch</p>"
else
echo "<p>"
echo "Cannot find CMS software area."
echo "</p>"
echo "ERROR: Cannot find CMS software in OSG node"
echo "summary: SW_DIR_UNDEF"
exit $SAME_ERROR
fi
elif [ -n "$VO_CMS_SW_DIR" ] ; then
echo "<p>gLite Middleware</p>"
SW_DIR=$VO_CMS_SW_DIR
else
echo "<p>ERROR: neither VO_CMS_SW_DIR nor OSG_APP defined</p>"
echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_GRID defined"
echo "summary: SW_DIR_UNDEF"
exit $SAME_ERROR
fi
echo "<pre>"
source $SW_DIR/cmsset_default.sh
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
export SCRAM_ARCH=slc5_amd64_gcc462
export BUILD_ARCH=$SCRAM_ARCH
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
result=$?
echo "</pre>"
if [ $result != 0 ]
then
echo "<p>ERROR: $VO_CMS_SW_DIR/cmsset_default.sh non existent or non readable</p>"
if [ $result != 0 ]; then
cat $tmpfile
rm -f $tmpfile
echo "ERROR: CMS software initialisation script cmsset_default.sh failed"
echo "summary: NO_SETUP_SCRIPT"
exit $SAME_ERROR
fi
echo "WMAgent thinks it found the correct CMSSW setup script"
rm -f $tmpfile
if [ -e $VO_CMS_SW_DIR/COMP/slc5_amd64_gcc434/external/python/2.6.4/etc/profile.d/init.sh ]
then
......@@ -65,47 +49,43 @@ command -v python2.6 > /dev/null
rc=$?
if [[ $rc != 0 ]]
then
echo "WMAgent Error: Python2.6 isn't available on this worker node." >&2
echo "WMAgent Error: WMCore/WMAgent REQUIRES python2.6" >&2
echo "ERROR: Python2.6 isn't available on this worker node." >&2
echo "ERROR: WMCore/WMAgent REQUIRES python2.6" >&2
echo "summary: PYTHON_26_NOT_FOUND"
exit $SAME_ERROR
else
echo "WMAgent found python2.6 at.."
echo "WMAgent found python2.6 at..."
echo `which python2.6`
echo
fi
export PYTHONPATH=$SAME_SENSOR_HOME/cms-MC-test/lib/python2.6/site-packages:$PYTHONPATH
echo "<h3>Checking PYTHONPATH</h3>"
echo "<pre>"
echo "PYTHONPATH=$PYTHONPATH"
echo "</pre>"
echo "<h3>Invoking site test</h3>"
echo "<pre>"
echo "USER/WHOAMI?:" $USER/`whoami`
echo "USER ID:" $UID
voms-proxy-info -all
echo "</pre>"
#echo "PYTHONPATH=$PYTHONPATH"
#echo
cd $SAME_SENSOR_HOME/cms-MC-test/
if [ $? -ne 0 ]; then
echo "<p>ERROR: Could not access the cms-MC-test directory</p>"
echo "ERROR: Could not access the cms-MC-test directory"
echo "summary: TEST_CODE_DIR_NOT_FOUND"
exit $SAME_ERROR
else
echo "<pre>"
chmod u+x RuntimeSAMStageOut.py
./RuntimeSAMStageOut.py > RuntimeSAMStageOut.out 2>&1
EXIT_STATUS=$?
sed -e 's/&/&amp;/g' RuntimeSAMStageOut.out | sed -e 's/</\&lt;/g' | sed -e 's/>/\&gt;/g'
echo "</pre>"
cat RuntimeSAMStageOut.out
fi
if [ $EXIT_STATUS -ne 0 -a $EXIT_STATUS -ne 4 ] ; then
echo "<p>ERROR: Stage Out Test failed: $EXIT_STATUS</p>"
echo "ERROR: Stage Out Test failed: $EXIT_STATUS"
echo "summary: STAGEOUT_FAILED"
exit $SAME_ERROR
elif [ $EXIT_STATUS -eq 4 ]; then
echo "<p>WARNING: Stage Out Test failed to cleanup the test file: $EXIT_STATUS</p>"
echo "WARNING: Stage Out Test failed to cleanup the test file: $EXIT_STATUS"
exit "summary: CLEANUP_FAILED"
exit $SAME_WARNING
else
echo "<p>Stage Out Test successful</p>"
echo "Stage Out Test successful"
echo "summary: OK"
exit $SAME_OK
fi
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