Commit d13c46e9 authored by ericw's avatar ericw
Browse files

Test of FroNtier under CMSSW

parent 4fd15441
#!/bin/sh
#
# Test of FroNtier under CMSSW
#
# Assumes:
# 1) environmental variables SAME_OK and SAME_ERROR are defined
# 2) . $CMS_PATH/cmsset_default.sh has already been run
#
uname -n
#
# Choose CMSSW version
#
cmsswvsn=CMSSW_1_2_0
#
# Check that environmental variable SAME_OK is set
#
if [ ! "${SAME_OK}" ]
then
printf "CMSSW_frontier.sh: Error. SAME_OK not defined\n"
exit 1
fi
#
# Check that scramv1 command was defined by . $CMS_PATH/cmsset_default.sh
#
type scramv1 > /dev/null 2>&1
sset=$?
if [ $sset -ne 0 ]
then
printf "CMSSW_frontier.sh: Error. scramv1 not found\n"
exit $SAME_ERROR
fi
#
# Get Working Directory
#
current=`pwd`
#
# Set up CMSSW
#
printf "scramv1 project CMSSW $cmsswvsn ... starting\n"
printf "scramv1 project CMSSW $cmsswvsn ... starting\n" 1>&2
scramv1 project CMSSW $cmsswvsn
scms=$?
if [ $scms -ne 0 ]
then
printf "CMSSW_frontier.sh: Error. $cmsswvsn not available\n"
exit $SAME_ERROR
fi
printf "scramv1 project CMSSW $cmsswvsn ... completed\n"
printf "scramv1 project CMSSW $cmsswvsn ... completed\n" 1>&2
#
cd $cmsswvsn/src
export SCRAM_ARCH=`scramv1 arch`
printf "scramv1 runtime -sh ... starting\n"
printf "scramv1 runtime -sh ... starting\n" 1>&2
eval `scramv1 runtime -sh | grep -v SCRAMRT_LSB_EXIT_REQUEUE | grep -v SCRAMRT_DOMAINNAME | grep -v SCRAMRT_LSB_JOBNAME`
printf "scramv1 runtime -sh ... completed\n"
printf "scramv1 runtime -sh ... completed\n" 1>&2
#
# Return to working directory
#
cd $current
#
# Report on site-local-config.xml
#
if [ -f $CMS_PATH/SITECONF/local/JobConfig/site-local-config.xml ]
then
printf "Contents of site-local-config.xml are:\n"
cat $CMS_PATH/SITECONF/local/JobConfig/site-local-config.xml
else
printf "CMSSW_frontier.sh: Error. No site-local-config.xml\n"
exit $SAME_ERROR
fi
#
# Test access to squid
#
node=`grep proxy $CMS_PATH/SITECONF/local/JobConfig/site-local-config.xml | cut -f 3 -d/ | cut -f 1 -d: | head -1`
ping -c 1 $node
sping=$?
if [ $sping -ne 0 ]
then
printf "CMSSW_frontier.sh: Error $sping from ping $node\n"
exit $SAME_ERROR
fi
#
# Set environmental variables for CORAL
#
export CORAL_AUTH_USER=""
export CORAL_AUTH_PASSWORD=""
export CORAL_WEBCACHE_ZIP_LEVEL=0
#
# Create configuration file for cmsRun
#
/bin/cat > ecal_pedestals.cfg <<EOI
# Configuration file for EventSetupTest_t
process TEST = {
es_source = PoolDBESSource { VPSet toGet = {
{ string record = "EcalPedestalsRcd"
string tag = "EcalPedestals_test" }
}
bool loadAll = true
#string connect = "oracle://devdb10/cms_cond_ecal"
untracked bool siteLocalConfig = true
string connect = "frontier://cms_conditions_data/FrontierInt/CMS_COND_ECAL"
string timetype = "runnumber"
}
source = EmptySource { untracked int32 maxEvents = 2
untracked uint32 firstRun = 1
untracked uint32 numberEventsInRun = 1
}
module get = EventSetupRecordDataGetter {
VPSet toGet = {
{ string record = "EcalPedestalsRcd"
vstring data = {"EcalPedestals"}
}
}
untracked bool verbose = true
}
module print = AsciiOutputModule { }
path p = { get }
endpath ep = { print }
}
EOI
printf "configuration file:\n"
cat ecal_pedestals.cfg
start=`date +%s`
#
# Run cmsRun
#
printf "Squid nogzip Access test for ECAL\n" 1>&2
printf "START TIME: `date` ACTION: Squid nogzip Access test for ECAL\n"
printf "`date` --> running cmsRun ...\n"
cmsRun -p ecal_pedestals.cfg
srun=$?
printf "`date` --> DONE\n"
stop=`date +%s`
if [ $srun -eq 0 ]
then
printf "ELAPSED TIME:$[ $stop - $start ] ACTION: SQUID ECAL\n"
printf "OK\n"
else
printf "CMSSW_frontier.sh: Error $srun from cmsRun\n"
exit $SAME_ERROR
fi
#
# Exit
#
exit $SAME_OK
Markdown is supported
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