Commit b6e7dbb0 authored by Andrea Sciaba's avatar Andrea Sciaba
Browse files

HTML-compliant output

parent e89d5e18
......@@ -9,13 +9,12 @@ cat $SAME_SENSOR_HOME/tests/CMS-SAM-Banner.html
echo "<h2>Preliminary checks</h2>"
echo "<pre>"
echo "version 2-11 13:00"
uname -a
date
voms-proxy-info -identity -fqan
id
cp -v $SAME_SENSOR_HOME/tests/fetch-from-web .
cp -v $SAME_SENSOR_HOME/tests/CMS-SAM-Banner.html .
cp $SAME_SENSOR_HOME/tests/fetch-from-web .
cp $SAME_SENSOR_HOME/tests/CMS-SAM-Banner.html .
echo "</pre>"
echo "<h2>Checking software directory</h2>"
......@@ -29,9 +28,11 @@ elif [ -n "$VO_CMS_SW_DIR" ] ; then
echo "VO_CMS_SW_DIR=$VO_CMS_SW_DIR"
else
echo "</pre>"
echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined"
echo "<p>"
echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined"
echo "<br />"
echo "summary: SW_DIR_UNDEF"
echo "</p>"
exit $SAME_ERROR
fi
ls -ld $SW_DIR
......@@ -40,16 +41,20 @@ echo "</pre>"
if [ $result != 0 ]
then
echo "ERROR: software directory non existent or non readable"
echo "<p>"
echo "ERROR: software directory non existent or non readable"
echo "<br />"
echo "summary: NO_SW_DIR"
echo "</p>"
exit $SAME_ERROR
fi
if [ ! -f $SW_DIR/cmsset_default.sh ] ; then
echo "ERROR: cmssw setup file $SW_DIR/cmsset_default.sh not existing"
echo "<p>"
echo "ERROR: cmssw setup file $SW_DIR/cmsset_default.sh not existing"
echo "<br />"
echo "summary: NO_SETUP_SCRIPT"
echo "</p>"
exit $SAME_ERROR
fi
......@@ -62,10 +67,14 @@ echo "</pre>"
if [ $result != 0 ]
then
echo "ERROR: CMS software initialisation script cmsset_default.sh failed"
echo "<p>"
echo "ERROR: CMS software initialisation script cmsset_default.sh failed"
echo "<br />"
echo "summary: NO_SETUP_SCRIPT"
echo "</p>"
exit $SAME_ERROR
else
echo "<p>OK</p>"
fi
echo "<h2>Check existence of configuration directory</h2>"
......@@ -73,48 +82,58 @@ echo "<pre>"
echo "CMS_PATH=$CMS_PATH"
echo "</pre>"
if [ -z $CMS_PATH ]; then
echo "ERROR: CMS_PATH not defined"
echo "<p>"
echo "ERROR: CMS_PATH not defined"
echo "<br />"
echo "summary: CMS_PATH_UNDEF"
echo "</p>"
exit $SAME_ERROR
fi
if [ ! -d $CMS_PATH ] ; then
echo "ERROR: CMS_PATH directory $CMS_PATH not existing"
echo "<p>"
echo "ERROR: CMS_PATH directory $CMS_PATH not existing"
echo "<br />"
echo "summary: NO_CMS_PATH"
echo "</p>"
exit $SAME_ERROR
fi
if [ ! -d $CMS_PATH/SITECONF/local/JobConfig ] ; then
echo "ERROR: JobConfig directory $CMS_PATH/SITECONF/local/JobConfig not existing"
echo "<p>"
echo "ERROR: JobConfig directory $CMS_PATH/SITECONF/local/JobConfig not existing"
echo "<br />"
echo "summary: NO_JOBCONFIG_DIR"
echo "</p>"
exit $SAME_ERROR
fi
echo "<h2>Check existence of configuration file</h2>"
echo "<p>OK</p>"
echo "<h2>Check existence of local configuration file</h2>"
ConfigFile=${CMS_PATH}/SITECONF/local/JobConfig/site-local-config.xml
echo "<pre>"
echo "$ConfigFile"
echo "Path: $ConfigFile"
echo "</pre>"
if [ ! -f $ConfigFile ] ; then
echo "ERROR: Local Configuration file site-local-config.xml not existing"
echo "<p>"
echo "ERROR: Local Configuration file site-local-config.xml not existing"
echo "<br />"
echo "summary: NO_SITELOCALCONFIG"
echo "</p>"
exit $SAME_ERROR
fi
echo "Dump of Local Configuration file is <a href=\"#CfgDump\">here</a>"
echo "<p>Dump of Local Configuration file is <a href=\"#CfgDump\">here</a></p>"
echo "<h2>Check entries for TFC, local stage, site name and Squid</h2>"
grep -q "trivialcatalog" $ConfigFile
status=$?
if [ $status != 0 ] ; then
echo "ERROR: TrivialFileCatlog string missing"
echo "<p>"
echo "<p>ERROR: TrivialFileCatalog string missing</p>"
errorSummary="summary: NO_TFC"
error=1
fi
......@@ -122,8 +141,7 @@ fi
grep -q "local-stage-out" $ConfigFile
status=$?
if [ $status != 0 ] ; then
echo "ERROR: LocalStageOut string missing"
echo "<p>"
echo "<p>ERROR: LocalStageOut string missing</p>"
errorSummary="summary: NO_LOCALSTAGEOUT"
error=1
fi
......@@ -131,8 +149,7 @@ fi
grep -q "site name" $ConfigFile
status=$?
if [ $status != 0 ] ; then
echo "ERROR: site name string missing"
echo "<p>"
echo "<p>ERROR: site name string missing</p>"
errorSummary="summary: NO_SiteName"
error=1
fi
......@@ -140,8 +157,7 @@ fi
grep -q "frontier-connect" $ConfigFile
status=$?
if [ $status != 0 ] ; then
echo "ERROR: Frontier Configuration string missing"
echo "<p>"
echo "<p>ERROR: Frontier Configuration string missing</p>"
errorSummary="summary: NO_FRONTIER_CONFIG"
error=1
fi
......@@ -149,23 +165,19 @@ fi
echo "<h2>Check TFC file existence</h2>"
TFCfile=`grep "trivialcatalog" $ConfigFile | cut -d':' -f2| cut -d'?' -f1|head -1`
echo "<pre>"
echo "$TFCfile"
echo "Path: $TFCfile"
echo "</pre>"
if [ ! -f $TFCfile ] ; then
echo "ERROR: TrivialFileCatalg $TFCfile not existing"
echo "<p>"
echo "<p>ERROR: TrivialFileCatalg $TFCfile not existing</p>"
errorSummary="summary: NO_TFC file"
error=1
fi
#if [ $err == 1 ] ; then
# exit $SAME_ERROR
#fi
if [ $error == 1 ] ; then
echo "ERROR: invalid local configuration file $ConfigFile"
echo "<p>"
echo "<p>ERROR: invalid local configuration file $ConfigFile<br />"
echo $errorSummary
echo "</p>"
fi
echo "<h2>Compare local configuration file and TFC with CVS</h2>"
......@@ -187,120 +199,111 @@ fi
asCvs=1
cvsUrl="\"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/COMP/SITECONF/${siteName}/JobConfig/site-local-config${_subSiteName}.xml?rev=HEAD&content-type=text/plain\""
cvsUrlp="\"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/COMP/SITECONF/${siteName}/JobConfig/site-local-config${_subSiteName}.xml?rev=HEAD&amp;content-type=text/plain\""
ConfigFileFromCVS=`mktemp /tmp/site-local-config-from-CVS.xml.XXX`
echo "CVS copy: $cvsUrl<br>"
echo "CVS copy: $cvsUrlp<br />"
./fetch-from-web $cvsUrl $ConfigFileFromCVS
rc=$?
echo "rc = $rc"
echo "</pre>"
[ $rc == $SAME_INFO ] && info=1
[ $rc == $SAME_NOTICE ] && note=1
[ $rc == "$SAME_INFO" ] && info=1
[ $rc == "$SAME_NOTICE" ] && note=1
#if [ $rc == $SAME_WARNING ] || [ $rc == $SAME_ERROR ] ; then
# echo "<br>INFO: failed to access CVS Web repository<bre>"
#else
if [ $rc == $SAME_OK ] || [ $rc == $SAME_INFO ] ; then
if [ $rc == "$SAME_OK" ] || [ $rc == "$SAME_INFO" ] ; then
diff -q -w -B $ConfigFile $ConfigFileFromCVS
if [ $? == 1 ] ; then asCvs=0; fi
if [ $asCvs == 0 ] ; then
noConfigDump=1
cvsMarkupUrl="\"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/COMP/SITECONF/${siteName}/JobConfig/site-local-config${_subSiteName}.xml?view=markup\""
ConfigFileMarkup=`mktemp /tmp/site-local-config-from-CVS-Markup.xml.XXX`
echo "Fetch CVS Markup copy of local config from $cvsMarkupUrl<br>"
echo "<p>Fetch CVS Markup copy of local config from $cvsMarkupUrl</p>"
echo "<pre>"
./fetch-from-web $cvsMarkupUrl $ConfigFileMarkup
rc=$?
echo "rc = $rc"
[ $rc == $SAME_INFO ] && info=1
[ $rc == $SAME_NOTICE ] && note=1
echo "</pre>"
[ $rc == "$SAME_INFO" ] && info=1
[ $rc == "$SAME_NOTICE" ] && note=1
cvsFileDate=`grep "<em>" $ConfigFileMarkup |head -1|awk -F '<em>|</em>' '{print $2 }'`
let seconds=`date +%s`-`date +%s -d "$cvsFileDate"`
let cvsFileAgeInHours=$seconds/3600
echo CVS version of Local Configuration file is ${cvsFileAgeInHours} hours old
echo "<p>CVS version of Local Configuration file is ${cvsFileAgeInHours} hours old</p>"
echo "<pre>"
if [ $localConfigFileAgeInHours -gt 72 ] && [ $cvsFileAgeInHours -gt 72 ] ; then
error=1
echo "</pre>"
echo "ERROR: local site configuration file differ from CVS"
echo "<p>ERROR: local site configuration file differ from CVS</p>"
else
warning=1
echo "</pre>"
echo "WARNING: local site configuration file differ from CVS"
echo "<br>"
echo "<will become error if this difference lasts more then 72h"
echo "<p>WARNING: local site configuration file differ from CVS"
echo "<br />"
echo "<will become error if this difference lasts more then 72h</p>"
fi
diffList=`mktemp /tmp/diflist.XXXX`
diff $ConfigFile $ConfigFileFromCVS > $diffList
cat $diffList | sed 's/</\&lt;/g' | sed 's/>/\&gt;/g'
rm -f $diffList
else
echo "OK"
echo "<p>OK</p>"
fi
rm -f $ConfigFileFromCVS
else
echo "NOTICE: failed to access CVS Web repository"
echo "<p>NOTICE: failed to access CVS Web repository</p>"
note=1
fi
echo "<br>"
TFCfileName=`echo $TFCfile | awk -F'/' '{print $NF}'`
echo "<pre>"
let seconds=`date +%s`-`stat -c%Y $TFCfile`
let localTFCfileAgeInHours=$seconds/3600
echo Local TFC file is ${localTFCfileAgeInHours} hours old
echo "Local TFC file is ${localTFCfileAgeInHours} hours old"
asCvs=1
#cvsUrl="\"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/COMP/SITECONF/${siteName}/PhEDEx/storage${_subSiteName}.xml?rev=HEAD&content-type=text/plain\""
cvsUrl="\"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/COMP/SITECONF/${siteName}/PhEDEx/${TFCfileName}?rev=HEAD&content-type=text/plain\""
cvsUrlp="\"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/COMP/SITECONF/${siteName}/PhEDEx/${TFCfileName}?rev=HEAD&amp;content-type=text/plain\""
echo TFC file name: $TFCfileName
echo cvsUrl: $cvsUrl
echo "TFC file name: $TFCfileName"
TfcFileFromCVS=`mktemp /tmp/storage-from-CVS.xml.XXXX`
echo "CVS copy: $cvsUrl<br>"
echo "CVS copy: $cvsUrlp"
./fetch-from-web $cvsUrl $TfcFileFromCVS
rc=$?
echo "rc = $rc <br>"
[ $rc == $SAME_INFO ] && info=1
[ $rc == $SAME_NOTICE ] && note=1
#if [ $rc == $SAME_WARNING ] || [ $rc == $SAME_ERROR ] ; then
# echo "<br>INFO: failed to access CVS Web repository<bre>"
#else
echo "rc = $rc"
[ $rc == "$SAME_INFO" ] && info=1
[ $rc == "$SAME_NOTICE" ] && note=1
echo "</pre>"
if [ $rc == $SAME_OK ] || [ $rc == $SAME_INFO ] ; then
if [ $rc == "$SAME_OK" ] || [ $rc == "$SAME_INFO" ] ; then
diff -q -w -B $TFCfile $TfcFileFromCVS
if [ $? == 1 ] ; then asCvs=0; fi
echo "<br>"
if [ $asCvs == 0 ] ; then
noTFCDump=1
cvsMarkupUrl="\"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/COMP/SITECONF/${siteName}/PhEDEx/${TFCfileName}?view=markup\""
TfcFileMarkup=`mktemp /tmp/TFC-from-CVS-Markup.xml.XXX`
echo "Fetch CVS Markup copy of TFC from $cvsMarkupUrl<br>"
echo "<pre>Fetch CVS Markup copy of TFC from $cvsMarkupUrl"
./fetch-from-web $cvsMarkupUrl $TfcFileMarkup
rc=$?
echo "rc = $rc <br>"
[ $rc == $SAME_INFO ] && info=1
[ $rc == $SAME_WARNING ] && warning=1
echo "rc = $rc"
echo "</pre>"
[ $rc == "$SAME_INFO" ] && info=1
[ $rc == "$SAME_WARNING" ] && warning=1
cvsFileDate=`grep "<em>" $TfcFileMarkup |head -1|awk -F '<em>|</em>' '{print $2 }'`
let seconds=`date +%s`-`date +%s -d "$cvsFileDate"`
let cvsFileAgeInHours=$seconds/3600
echo "<pre>"
echo CVS version of Local Configuration file is ${cvsFileAgeInHours} hours old
echo "CVS version of Local Configuration file is ${cvsFileAgeInHours} hours old"
echo "</pre>"
if [ $localTFCfileAgeInHours -gt 72 ] && [ $cvsFileAgeInHours -gt 72 ] ; then
# if [ $localTFCfileAgeInHours -gt 72 ] ; then
error=1
echo "ERROR: local Trivial Catalog File file differ from CVS"
echo "<p>ERROR: local Trivial Catalog File file differ from CVS</p>"
else
echo "WARNING: local Trivial Catalog File differ from CVS"
echo "<br>"
echo "will become error if this difference lasts more then 72h"
echo "<p>WARNING: local Trivial Catalog File differ from CVS<br />"
echo "will become error if this difference lasts more then 72h</p>"
fi
diffList=`mktemp /tmp/diflist.XXXX`
diff $TFCfile $TfcFileFromCVS > $diffList
......@@ -309,19 +312,17 @@ if [ $rc == $SAME_OK ] || [ $rc == $SAME_INFO ] ; then
echo "</pre>"
rm -f $diffList
else
echo "OK"
echo "<br>"
echo "<p>OK</p>"
fi
rm -f $TfcFileFromCVS
else
echo "NOTICE: failed to access CVS Web repository"
echo "<p>NOTICE: failed to access CVS Web repository</p>"
note=1
fi
echo "<p>"
echo "Dump of TFC file is <a href=\"#TFCDump\">here</a>"
echo "<p>Dump of TFC file is <a href=\"#TFCDump\">here</a></p>"
echo "<h2>Check commands for remote stageout</h2>"
echo "Needs at least ( lcg_utils 1.6.7 and gfal 1.10.8 ) or ( srmcp 2.0 ) "
echo "<p>Needs at least ( lcg_utils 1.6.7 and gfal 1.10.8 ) or ( srmcp 2.0 )</p>"
echo "<pre>"
stageOutError=1
......@@ -372,7 +373,7 @@ if [ $rc == 0 ] ; then
fi
echo "</pre>"
if [ $note == 1 ] ; then
echo "NOTE: proper version of lcg-cp not available"
echo "<p>NOTE: proper version of lcg-cp not available</p>"
fi
echo "<pre>"
......@@ -385,7 +386,6 @@ if [ $rc == 0 ] ; then
srmcpVersion=`srmcp -version 2>&1|egrep "Client version"|awk '{print $(NF)'}`
srmcpV1=`echo $srmcpVersion|cut -d. -f1`
srmcpV2=`echo $srmcpVersion|cut -d. -f2`
# srmcpV3=`echo $srmcpVersion|cut -d. -f3`
if [ $srmcpV1 -ge 2 ] ; then
stageOutError=0
fi
......@@ -393,15 +393,14 @@ fi
echo "</pre>"
if [ $stageOutError == 1 ] ; then
echo "ERROR: No validated command for remote stageout available"
echo "<p>"
echo "<p>ERROR: No validated command for remote stageout available</p>"
error=1
else
echo "OK"
echo "<p>OK</p>"
fi
echo "<hr>"
echo "<hr />"
echo "<h2>Dump of local configuration files</h2><br>"
echo "<h2>Dump of local configuration files</h2>"
if [ -n "$noConfigDump" ] ; then
echo "<h3><a name="CfgDump"></a>Configuration File Dump</h3>"
......@@ -417,31 +416,31 @@ cat $TFCfile | sed 's/</\&lt;/g' | sed 's/>/\&gt;/g'
echo "</pre>"
fi
echo '<h1><a name="summary"> Test Summary</a></h1><p>'
echo '<h1><a name="summary"> Test Summary</a></h1>'
if [ $error == 1 ]
then
echo "ERROR"
echo "<p>ERROR</p>"
exit $SAME_ERROR
fi
if [ $warning == 1 ]
then
echo "WARNING"
echo "<p>WARNING</p>"
exit $SAME_WARNING
fi
if [ $note == 1 ]
then
echo "<p>NOTE"
echo "<p>NOTE</p>"
exit $SAME_WARNING
fi
if [ $info == 1 ]
then
echo "INFO"
echo "<p>INFO</p>"
exit $SAME_OK
fi
echo "OK"
echo "<p>OK</p>"
exit $SAME_OK
<h2>
<p>
For information on SAM tests:
<a href="https://twiki.cern.ch/twiki/bin/view/CMS/SAMForCMS">SAMForCMS twiki</a>
<p>
<br />
To report problems go to
<a href="https://savannah.cern.ch/support/?func=additem&group=cmscompinfrasup">Computing Infrastructure Savannah</a>
<a href="https://savannah.cern.ch/support/?func=additem&amp;group=cmscompinfrasup">Computing Infrastructure Savannah</a>
and select "SAM Tests" as category.
<br>Please login into Savannah with your NICE credentials to know who opened the ticket'
</h2>
<hr>
<br />
Please login into Savannah with your NICE credentials to know who opened the ticket
</p>
<hr />
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