Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:48:13

0001 #!/bin/bash
0002 #
0003 # test record<->XML traslators, then use popcon to write sqlite file
0004 # then read it back and write XML again. Finally test that initial and
0005 # final XML are the same
0006 #
0007 # author: Stefano Argiro'
0008 # $Id: testEcalConditionsPopCon.sh,v 1.1 2008/11/14 15:47:01 argiro Exp $
0009 #
0010 
0011 
0012 # test target directory and filenames are hardcoded, sigh !
0013 
0014 echo Testing Ecal XML PopCon Conditions
0015 
0016 eval `scramv1 runtime -sh`
0017 
0018 #clean up
0019 rm -f /tmp/Ecal*.xml
0020 mkdir -p /tmp/sub/
0021 rm -f /tmp/sub/Ecal*.xml
0022 rm -f *.db
0023 
0024 #test XML translator and write XML files
0025 $CMSSW_BASE/test/slc4_ia32_gcc345/testXMLTranslators
0026 
0027 
0028 #use PopCon to write sqlite files
0029 for cfg in `ls testEcal*.py ` ; do
0030     cmsRun  $cfg
0031 done
0032 
0033 #read back sqlite files and write XML again
0034 cmsRun testReaddbWriteXML.py
0035 
0036 exstatus=0
0037 
0038 #test that initial and final XML are the same
0039 for file in `ls /tmp/Ecal*.xml` ; do
0040    diff --brief $file /tmp/sub/`basename $file`
0041    let exstatus+=$? 
0042 done
0043 
0044 if [ $exstatus -ne 0 ] ; then
0045   echo Test FAILED
0046 else
0047   echo Test PASSED
0048 fi
0049 
0050 # clean up junk
0051 rm -f /tmp/Ecal*.xml
0052 rm -f /tmp/sub/Ecal*.xml
0053 rm -f *.db