Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
etf
cmssam
Commits
f1d37caf
Commit
f1d37caf
authored
Oct 28, 2009
by
Andrea Sciaba
Browse files
Test analysis test with CMSSW_2_1_13
parent
349f44c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
SiteTests/testjob/tests/CE-cms-dummy
View file @
f1d37caf
#!/bin/sh
shopt
-s
expand_aliases
info
=
0
note
=
0
warning
=
0
error
=
0
err
=
0
warn
=
0
cmsswvsn
=
CMSSW_2_1_13
cat
$SAME_SENSOR_HOME
/tests/CMS-SAM-Banner.html
echo
'<h1><a href="#summary">Jump to test summary</a></h1>'
echo
"<h2>Preliminary checks</h2>"
echo
"<pre>"
echo
"version 2
-11
1
3
:00"
echo
"version 2
3-9
1
7
:00"
set
-x
uname
-a
cat
/etc/issue
date
date
--utc
voms-proxy-info
-identity
-fqan
id
cp
-v
$SAME_SENSOR_HOME
/tests/fetch-from-web
.
#ls -l fetch-from-web
cp
-v
$SAME_SENSOR_HOME
/tests/CMS-SAM-Banner.html
.
env
|grep SAME
set
+x
echo
"</pre>"
echo
"<h2>Checking software directory for CMS VO</h2>"
echo
"<h2><a name="
Analysis Test
"></a>Analysis Test</h2>"
# Source the CMS environment
echo
"<h3>Sourcing the CMS environment</h3>"
export
SCRAM_ARCH
=
slc4_ia32_gcc345
export
BUILD_ARCH
=
slc4_ia32_gcc345
if
[
-n
"
$OSG_APP
"
]
;
then
SW_DIR
=
$OSG_APP
/cmssoft/cms
[
-f
$OSG_GRID
/setup.sh
]
&&
source
$OSG_GRID
/setup.sh
echo
"Checking variable:
\$
OSG_APP/cmssoft/cms=
$OSG_APP
/cmssoft/cms"
elif
[
-n
"
$VO_CMS_SW_DIR
"
]
;
then
SW_DIR
=
$VO_CMS_SW_DIR
echo
"Checking variable:
\$
VO_CMS_SW_DIR=
$VO_CMS_SW_DIR
"
else
echo
"ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined"
echo
"summary: SW_DIR_UNDEF"
exit
$SAME_ERROR
fi
tmpfile
=
`
mktemp
/tmp/tmp.XXXXXXXXXX
`
echo
"<pre>"
set
-x
ls
-ld
$SW_DIR
source
$SW_DIR
/cmsset_default.sh
>
$tmpfile
2>&1
result
=
$?
set
+x
cat
$tmpfile
echo
"</pre>"
echo
grep
'Your shell is not able to find'
$tmpfile
>
/dev/null
result2
=
$?
rm
-f
$tmpfile
if
[
$result
!=
0
]
then
echo
"ERROR: software directory non existent or non readable"
echo
"summary: NO_SW_DIR"
echo
"ERROR:
$SW_DIR
/cmsset_default.sh non existent or non readable"
exit
$SAME_ERROR
fi
if
[
!
-f
$SW_DIR
/cmsset_default.sh
]
;
then
echo
"<h3>"
echo
"ERROR: cmssw setup file
$SW_DIR
/cmsset_default.sh not existing"
echo
"</h3>"
echo
"summary: NO_SETUP_SCRIPT"
if
[
$result2
==
0
]
then
echo
"ERROR:
$SW_DIR
/cmsset_default.sh failed"
exit
$SAME_ERROR
fi
echo
"<h2>Sourc
in
g
t
he CMS environment</h2>"
e
xport
SCRAM_ARCH
=
slc4_ia32_gcc345
# Execute ma
in t
est scripts
e
cho
"<h3>Test analysis of data from /store/data </h3>"
echo
"<pre>"
source
$SW_DIR
/cmsset_default.sh
echo
" SAME_SENSOR_HOME: "
$SAME_SENSOR_HOME
echo
"Running
$SAME_SENSOR_HOME
/tests/AnalysisTest.sh
$cmsswvsn
2>&1"
AnalysisTestWorkDir
=
`
mktemp
-d
AnalysisTestWorkDir.XXXXXXXXXX
`
pushd
.
>
/dev/null
cd
$AnalysisTestWorkDir
pwd
$SAME_SENSOR_HOME
/tests/AnalysisTest.sh
$cmsswvsn
2>&1
result
=
$?
echo
"AnalysisTest.sh executed with exit code "
$result
echo
"</pre>"
popd
>
/dev/null
if
[
$result
!=
0
]
then
echo
"<h3>"
echo
"ERROR: CMS software initialisation script cmsset_default.sh failed"
echo
"summary: NO_SETUP_SCRIPT"
echo
"</h3>"
exit
$SAME_ERROR
fi
echo
"<h2>Make sure configuration directory is there</h2>"
echo
"Checking variable:
\$
CMS_PATH=
$CMS_PATH
"
echo
"<p>"
if
[
-z
$CMS_PATH
]
;
then
echo
"<h3>"
echo
"ERROR: CMS_PATH not defined"
echo
"summary: CMS_PATH_UNDEF"
echo
"</h3>"
exit
$SAME_ERROR
fi
if
[
!
-d
$CMS_PATH
]
;
then
echo
"<h3>"
echo
"ERROR: CMS_PATH directory
$CMS_PATH
not existing"
echo
"summary: NO_CMS_PATH"
echo
"</h3>"
exit
$SAME_ERROR
fi
if
[
!
-d
$CMS_PATH
/SITECONF/local/JobConfig
]
;
then
echo
"<h3>"
echo
"ERROR: JobConfig directory
$CMS_PATH
/SITECONF/local/JobConfig not existing"
echo
"summary: NO_JOBCONFIG_DIR"
echo
"</h3>"
exit
$SAME_ERROR
fi
echo
"<p>"
echo
"OK"
echo
"<h2>Make sure configuration file exists</h2>"
ConfigFile
=
${
CMS_PATH
}
/SITECONF/local/JobConfig/site-local-config.xml
echo
"Configuration file:
$ConfigFile
"
echo
"<p>"
if
[
!
-f
$ConfigFile
]
;
then
echo
"<h3>"
echo
"ERROR: Local Configuration file site-local-config.xml not existing"
echo
"summary: NO_SITELOCALCONFIG"
echo
"</h3>"
exit
$SAME_ERROR
fi
echo
"<p>"
echo
"OK"
echo
"dump of Local Configuration file is <a href=
\"
#CfgDump
\"
>here</a>"
echo
"<h2>Make sure local configuration file has entries for TriviaFileCatalog,
local stage, site name and Squid</h2>"
grep
-q
"trivialcatalog"
$ConfigFile
status
=
$?
if
[
$status
!=
0
]
;
then
echo
"ERROR: TrivialFileCatlog string missing"
errorSummary
=
"summary: NO_TFC"
error
=
1
fi
grep
-q
"local-stage-out"
$ConfigFile
status
=
$?
if
[
$status
!=
0
]
;
then
echo
"ERROR: LocalStageOut string missing"
errorSummary
=
"summary: NO_LOCALSTAGEOUT"
error
=
1
fi
grep
-q
"site name"
$ConfigFile
status
=
$?
if
[
$status
!=
0
]
;
then
echo
"ERROR: site name string missing"
errorSummary
=
"summary: NO_SiteName"
error
=
1
fi
grep
-q
"frontier-connect"
$ConfigFile
status
=
$?
if
[
$status
!=
0
]
;
then
echo
"ERROR: Frontier Configuration string missing"
errorSummary
=
"summary: NO_FRONTIER_CONFIG"
error
=
1
fi
if
[
$error
==
0
]
;
then
echo
"<p>"
echo
"OK"
fi
echo
"<p>"
echo
"<h2>Make sure TFC file is where config file says it should be</h2>"
TFCfile
=
`
grep
"trivialcatalog"
$ConfigFile
|
cut
-d
':'
-f2
|
cut
-d
'?'
-f1
|head
-1
`
echo
"Checking file:
$TFCfile
"
if
[
!
-f
$TFCfile
]
;
then
echo
"ERROR: TrivialFileCatalg
$TFCfile
not existing"
errorSummary
=
"summary: NO_TFC file"
error
=
1
if
[
$result
==
$SAME_WARNING
]
;
then
warn
=
1
fi
#if [ $err == 1 ] ; then
# exit $SAME_ERROR
#fi
echo
"<p>"
echo
"OK"
echo
"<p>"
if
[
$error
==
1
]
;
then
echo
"<h3>"
echo
"ERROR: invalid local configuration file
$ConfigFile
"
echo
$errorSummary
echo
"</h3>"
if
[
$result
==
$SAME_ERROR
]
;
then
err
=
1
fi
echo
"<h2>Compare local configuration file and TFC with CVS</h2>"
siteName
=
`
grep
"site name"
$ConfigFile
|
grep
-v
"subsite name"
|
cut
-d
'"'
-f2
`
echo
"<h3>Test analysis of data from /store/user </h3>"
echo
"<pre>"
let
seconds
=
`
date
+%s
`
-
`
stat
-c
%Y
$ConfigFile
`
let
localConfigFileAgeInHours
=
$seconds
/3600
echo local
configuration file
${
ConfigFile
}
is
${
localConfigFileAgeInHours
}
hours old
echo
siteName
=
$siteName
subSiteName
=
`
grep
"subsite name"
$ConfigFile
|
cut
-d
'"'
-f2
`
_subSiteName
=
if
[
"x
$subSiteName
"
==
"x"
]
;
then
echo
"subSiteName ="
$subSiteName
else
echo
"subSiteName ="
$subSiteName
_subSiteName
=
_
`
echo
$subSiteName
`
fi
echo
"<br>"
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
\"
"
ConfigFileFromCVS
=
`
mktemp
/tmp/site-local-config-from-CVS.xml.XXX
`
echo
"Fetch CVS copy of local config from
$cvsUrl
<br>"
./fetch-from-web
$cvsUrl
$ConfigFileFromCVS
rc
=
$?
echo
"rc =
$rc
<br>"
[
$rc
==
$SAME_INFO
]
&&
info
=
1
[
$rc
==
$SAME_WARNING
]
&&
warning
=
1
#if [ $rc == $SAME_WARNING ] || [ $rc == $SAME_ERROR ] ; then
# echo "<br>INFO: failed to access CVS Web repository<bre>"
#else
echo
"</pre>"
if
[
$rc
==
$SAME_OK
]
||
[
$rc
==
$SAME_INFO
]
;
then
diff
-q
-w
-B
$ConfigFile
$ConfigFileFromCVS
if
[
$?
==
1
]
;
then
asCvs
=
0
;
fi
echo
"<br>"
if
[
$asCvs
==
0
]
;
then
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>"
./fetch-from-web
$cvsMarkupUrl
$ConfigFileMarkup
rc
=
$?
echo
"rc =
$rc
<br>"
[
$rc
==
$SAME_INFO
]
&&
info
=
1
[
$rc
==
$SAME_WARNING
]
&&
warning
=
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
"<pre>"
echo
CVS version of Local Configuration file is
${
cvsFileAgeInHours
}
hours old
echo
"</pre>"
if
[
$localConfigFileAgeInHours
-gt
72
]
&&
[
$cvsFileAgeInHours
-gt
72
]
;
then
error
=
1
echo
"<strong>ERROR: local site configuration file differ from CVS</strong>"
else
warning
=
1
echo
"<strong>WARNING: local site configuration file differ from CVS</strong>"
echo
"<br>will become error if this difference lasts more then 72h"
fi
diffList
=
`
mktemp
/tmp/diflist.XXXX
`
diff
$ConfigFile
$ConfigFileFromCVS
>
$diffList
echo
"<pre>"
cat
$diffList
|
sed
's/</\</g'
|
sed
's/>/\>/g'
echo
"</pre>"
rm
-f
$diffList
else
echo
"OK local site configuration file agrees with CVS copy"
echo
"<br>"
fi
rm
-f
$ConfigFileFromCVS
else
echo
"<br>INFO: failed to access CVS Web repository<bre>"
info
=
1
fi
echo
"<br>"
echo
"dump of Local Configuration file is <a href=
\"
#CfgDump
\"
>here</a>"
echo
"<br>"
TFCfileName
=
`
echo
$TFCfile
|
awk
-F
'/'
'{print $NF}'
`
echo
"<pre>"
let
seconds
=
`
date
+%s
`
-
`
stat
-c
%Y
$ConfigFile
`
let
localTFCfileAgeInHours
=
$seconds
/3600
echo local
TFC file
${
TFCfile
}
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
\"
"
echo
TFCfileName:
$TFCfileName
echo
cvsUrl
$cvsUrl
echo
"</pre>"
TfcFileFromCVS
=
`
mktemp
/tmp/storage-from-CVS.xml.XXXX
`
echo
"Fetch CVS copy of TFC from
$cvsUrl
<br>"
./fetch-from-web
$cvsUrl
$TfcFileFromCVS
rc
=
$?
echo
"rc =
$rc
<br>"
[
$rc
==
$SAME_INFO
]
&&
info
=
1
[
$rc
==
$SAME_WARNING
]
&&
warning
=
1
#if [ $rc == $SAME_WARNING ] || [ $rc == $SAME_ERROR ] ; then
# echo "<br>INFO: failed to access CVS Web repository<bre>"
#else
echo
" SAME_SENSOR_HOME: "
$SAME_SENSOR_HOME
echo
"Running
$SAME_SENSOR_HOME
/tests/AnalysisTestUser.sh
$cmsswvsn
2>&1"
AnalysisTestUserWorkDir
=
`
mktemp
-d
AnalysisTestUserWorkDir.XXXXXXXXXX
`
pushd
.
>
/dev/null
cd
$AnalysisTestUserWorkDir
pwd
$SAME_SENSOR_HOME
/tests/AnalysisTestUser.sh
$cmsswvsn
2>&1
result
=
$?
echo
"</pre>"
popd
>
/dev/null
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
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>"
./fetch-from-web
$cvsMarkupUrl
$TfcFileMarkup
rc
=
$?
echo
"rc =
$rc
<br>"
[
$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
"</pre>"
if
[
$localTFCfileAgeInHours
-gt
72
]
&&
[
$cvsFileAgeInHours
-gt
72
]
;
then
# if [ $localTFCfileAgeInHours -gt 72 ] ; then
error
=
1
echo
"<strong>ERROR: local Trivial Catalog File file differ from CVS</strong>"
else
echo
"<strong>WARNING: local Trivial Catalog File differ from CVS</strong>"
echo
"<br>will become error if this difference lasts more then 72h"
fi
diffList
=
`
mktemp
/tmp/diflist.XXXX
`
diff
$TFCfile
$TfcFileFromCVS
>
$diffList
echo
"<pre>"
cat
$diffList
|
sed
's/</\</g'
|
sed
's/>/\>/g'
echo
"</pre>"
rm
-f
$diffList
else
echo
"OK local Trivial File Catalog file agrees with CVS copy"
echo
"<br>"
fi
rm
-f
$TfcFileFromCVS
else
echo
"<br>INFO: failed to access CVS Web repository<bre>"
info
=
1
if
[
$result
!=
$SAME_OK
]
;
then
warn
=
1
fi
echo
"<p>dump of TFC file is <a href=
\"
#TFCDump
\"
>here</a>"
echo
"<p>"
echo
"<h2>Verify presence of commands needed for remote stageout</h2>"
echo
"Needs at least ( lcg_utils 1.6.7 and gfal 1.10.8 ) or ( srmcp 2.0 ) "
echo
"<p>"
echo
"<pre>"
stageOutError
=
1
note
=
1
which lcg-cp
rc
=
$?
if
[
$rc
==
0
]
;
then
lcg-cp
--version
lcgVersion
=
`
lcg-cp
--version
|grep
"lcg_util"
|cut
-d
'-'
-f2
`
gfalVersion
=
`
lcg-cp
--version
|grep GFAL|cut
-d
'-'
-f3
`
lcgV1
=
`
echo
$lcgVersion
|cut
-d
.
-f1
`
lcgV2
=
`
echo
$lcgVersion
|cut
-d
.
-f2
`
lcgV3
=
`
echo
$lcgVersion
|cut
-d
.
-f3
`
gfalV1
=
`
echo
$gfalVersion
|cut
-d
.
-f1
`
gfalV2
=
`
echo
$gfalVersion
|cut
-d
.
-f2
`
gfalV3
=
`
echo
$gfalVersion
|cut
-d
.
-f3
`
lcgOK
=
0
if
[
$lcgV1
-gt
1
]
;
then
lcgOK
=
1
else
if
[
$lcgV1
-eq
1
]
&&
[
$lcgV2
-gt
6
]
;
then
lcgOK
=
1
else
if
[
$lcgV2
-eq
6
]
&&
[
$lcgV3
-ge
7
]
;
then
lcgOK
=
1
fi
fi
fi
gfalOK
=
0
if
[
$gfalV1
-gt
1
]
;
then
gfalOK
=
1
else
if
[
$gfalV1
-eq
1
]
&&
[
$gfalV2
-gt
10
]
;
then
gfalOK
=
1
else
if
[
$gfalV2
-eq
10
]
&&
[
$gfalV3
-ge
8
]
;
then
gfalOK
=
1
fi
fi
fi
if
[
$lcgOK
==
1
]
;
then
if
[
$gfalOK
==
1
]
;
then
stageOutError
=
0
note
=
0
fi
fi
fi
if
[
$note
==
1
]
;
then
echo
"<strong>"
echo
"NOTE: proper version of lcg-cp not available"
echo
"</strong>"
fi
echo
"</pre><p><pre>"
which srmcp
rc
=
$?
if
[
$rc
==
0
]
;
then
srmcp
-version
|
grep
-v
WARNING
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
fi
echo
"</pre>"
if
[
$stageOutError
==
1
]
;
then
echo
"ERROR: No validated command for remote stageout available"
error
=
1
else
echo
"OK"
fi
echo
"<p>"
echo
"<p>"
echo
"<hr>"
echo
"<p>"
echo
"<h2>Dump of local configuration files</h2><br>"
echo
"<h3><a name="
CfgDump
"></a>Configuration File Dump</h3><pre>"
cat
$ConfigFile
|
sed
's/</\</g'
|
sed
's/>/\>/g'
echo
"</pre>"
echo
"<h3><a name="
TFCDump
"></a>TFC file Dump</h3><pre>"
cat
$TFCfile
|
sed
's/</\</g'
|
sed
's/>/\>/g'
echo
"</pre>"
echo
'<h1><a name="summary"> Test Summary</a></h1><p>'
if
[
$error
==
1
]
then
echo
"<p><strong> ERROR </strong></p>"
exit
$SAME_ERROR
fi
if
[
$warning
==
1
]
then
echo
"<p><strong> WARNING </strong></p>"
exit
$SAME_WARNING
fi
if
[
$note
==
1
]
then
echo
"<p><strong> NOTE </strong></p>"
exit
$SAME_NOTICE
if
[
$err
==
1
]
;
then
exit
$SAME_ERROR
fi
if
[
$info
==
1
]
then
echo
"<p><strong> INFO </strong></p>"
exit
$SAME_INFO
if
[
$warn
==
1
]
;
then
exit
$SAME_WARNING
fi
echo
"<p><strong> OK </strong></p>"
exit
$SAME_OK
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment