Newer
Older
#!/bin/bash
echo "<h2>Stage out test for the Monte Carlo production</h2>"
# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
if [ -n "$OSG_APP" ] ; then
echo "OSG site"
source $OSG_GRID/setup.sh
result=$?
elif [ -n "$VO_CMS_SW_DIR" ] ; then
echo "LCG site"
SW_DIR=$VO_CMS_SW_DIR
result=$?
echo "ERROR: neither VO_CMS_SW_DIR nor OSG_APP defined"
exit $SAME_ERROR
fi
echo "<pre>"
source $SW_DIR/cmsset_default.sh
result=$(expr $? + $result)
echo "</pre>"
if [ $result != 0 ]
then
echo "ERROR: $VO_CMS_SW_DIR/cmsset_default.sh non existent or non readable"
exit $SAME_ERROR
fi
export PYTHONPATH=$SAME_SENSOR_HOME/cms-MC-test:$PYTHONPATH
echo "<h3>Checking PYTHONPATH</h3>"
echo "<pre>"
echo "PYTHONPATH=$PYTHONPATH"
echo "</pre>"
echo "<h3>Invoking site test</h3>"
echo "<pre>"
echo "<h5>"
echo "USER/WHOAMI?:" $USER/`whoami`
echo "USER ID:" $uid
voms-proxy-info -all
echo "</h5>"
cd $SAME_SENSOR_HOME/cms-MC-test/
if [ $? -ne 0 ]; then
echo "ERROR: Could not access the cms-MC-test directory"
exit $SAME_ERROR
else
chmod u+x RuntimeSAMStageOut.py
./RuntimeSAMStageOut.py
EXIT_STATUS=$?
fi