Skip to content
Snippets Groups Projects
CE-cms-mc 1.39 KiB
Newer Older
Andrea Sciaba's avatar
Andrea Sciaba committed
#!/bin/bash

echo "<h2>Stage out test for the Monte Carlo production</h2>"

# Source the CMS environment
echo "<h3>Sourcing the CMS environment</h3>"
export SCRAM_ARCH=slc3_ia32_gcc323
Andrea Sciaba's avatar
Andrea Sciaba committed
    SW_DIR=$OSG_APP/cmssoft/cms
elif [ -n "$VO_CMS_SW_DIR" ] ; then
    echo "LCG site"
    SW_DIR=$VO_CMS_SW_DIR
    result=$?
Andrea Sciaba's avatar
Andrea Sciaba committed
else
    echo "ERROR: neither VO_CMS_SW_DIR nor OSG_APP defined"
Andrea Sciaba's avatar
Andrea Sciaba committed
    exit $SAME_ERROR
fi
echo "<pre>"
source $SW_DIR/cmsset_default.sh
Andrea Sciaba's avatar
Andrea Sciaba committed
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 "USER/WHOAMI?:" $USER/`whoami`
echo "USER ID:" $uid

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
Andrea Sciaba's avatar
Andrea Sciaba committed
echo "</pre>"

if [ $EXIT_STATUS -ne 0 ]; then
   echo "ERROR: Stage Out Test failed: $EXIT_STATUS"
   exit $SAME_ERROR
else
   echo "Stage Out Test successful"
   exit $SAME_OK
fi