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
0c9f4016
Commit
0c9f4016
authored
Jan 15, 2010
by
Stefano Belforte
Browse files
test swinst for CREAM
parent
9da6398b
Changes
1
Hide whitespace changes
Inline
Side-by-side
SiteTests/testjob/tests/CE-cms-dummy
View file @
0c9f4016
...
...
@@ -6,7 +6,6 @@ warning=0
error
=
0
isEGEE
=
0
isOSG
=
0
lcglsOK
=
0
cat
$SAME_SENSOR_HOME
/tests/CMS-SAM-Banner.html
...
...
@@ -14,12 +13,13 @@ echo '<h1><a href="#summary">Jump to test summary</a></h1>'
echo
"<h2>Preliminary checks</h2>"
echo
"<pre>"
echo
"version
04
-0
3
-200
9
1
0
:00"
echo
"version
12
-0
1
-20
1
0 1
7
:00"
uname
-a
cat
/etc/issue
date
date
--utc
voms-proxy-info
-identity
-fqan
id
workdir
=
`
mktemp
-d
workdirXXXXXX
`
cd
$workdir
cp
-v
$SAME_SENSOR_HOME
/tests/cmssw_required_version_list.txt
.
...
...
@@ -27,18 +27,18 @@ cp -v $SAME_SENSOR_HOME/tests/fetch-from-web .
[
-n
"
$GLITE_WMS_RB_BROKERINFO
"
]
&&
cp
-v
$GLITE_WMS_RB_BROKERINFO
.
[
-n
"
$EDG_WL_RB_BROKERINFO
"
]
&&
cp
-v
$EDG_WL_RB_BROKERINFO
.
cp
-v
$HOME
/.BrokerInfo
.
echo
"</pre>"
echo
"==========================================="
echo
"===== CHECK lcg-ls ========================"
set
-x
which lcg-ls
ls
-l
`
which lcg-ls
`
set
+x
echo
"==========================================="
echo
"Memory:"
echo
"<pre>"
cat
/proc/meminfo
echo
"</pre>"
echo
"<p>"
echo
"<h2>Checking software directory for CMS VO</h2>"
echo
"<p>"
if
[
-n
"
$OSG_APP
"
]
;
then
isOSG
=
1
...
...
@@ -56,9 +56,215 @@ else
echo
"</strong></p>"
exit
$SAME_ERROR
fi
echo
"<pre>"
ls
-ld
$SW_DIR
result
=
$?
echo
"</pre>"
echo
if
[
$result
!=
0
]
then
echo
"<strong><p>"
echo
"ERROR: software
$SW_DIR
directory non existent or non readable"
echo
"</strong></p>"
# echo "summary: NO_SW_DIR"
exit
$SAME_ERROR
fi
echo
"<h2><a name="
DiskSpace
"></a>Some trivial checks</h2>"
if
[
"
`
echo
$SW_DIR
|
cut
-d
/
-f
2
`
"
==
"afs"
]
;
then
echo
"AFS mode"
SPACE
=
`
fs lq
$SW_DIR
|
tail
-1
|
awk
'{print (\$2-\$3)/1024 }'
`
else
SPACE
=
`
df
-k
-P
$SW_DIR
|
tail
-1
|
awk
'{print \$4/1024}'
`
fi
echo
"Free disk space in
$SW_DIR
:
$SPACE
MB"
cantwrite
=
0
# on EGEE (but not CERN) check that lcgadmin can write to SW area
if
[
$isEGEE
==
1
]
&&
!
(
echo
$SW_DIR
|
grep
cern.ch
)
then
echo
"<pre>"
touch
$SW_DIR
/.sametest
result
=
$?
echo
"</pre>"
if
[
$result
!=
0
]
then
cantwrite
=
1
echo
"WARNING: cannot write to software area"
fi
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>"
exit
$SAME_ERROR
fi
echo
"<h2>Sourcing the CMS environment</h2>"
echo
"<pre>"
echo
"source
$SW_DIR
/cmsset_default.sh"
echo
"</pre>"
archs_defined
=
'slc4_ia32_gcc345 slc5_ia32_gcc434 slc3_ia32_gcc323'
archs_to_test
=
'slc4_ia32_gcc345'
swok
=
0
for
arch
in
$archs_defined
;
do
if
[
$swok
!=
1
]
;
then
export
SCRAM_ARCH
=
$arch
export
BUILD_ARCH
=
$arch
echo
"<p>"
echo
"Testing with SCRAM_ARCH=
$arch
..."
echo
"</p>"
echo
"<pre>"
rm
-f
cmsset.log
source
$SW_DIR
/cmsset_default.sh
>
cmsset.log 2>&1
result
=
$?
cat
cmsset.log
echo
"</pre>"
echo
grep
'No such file or directory'
cmsset.log
>
/dev/null 2>&1
res
=
$?
if
[
$res
==
0
]
;
then
result
=
1
fi
if
[
$result
!=
0
]
then
echo
"<p>"
echo
"WARNING: CMS software initialisation script cmsset_default.sh failed for SCRAM_ARCH=
$arch
"
echo
"</p>"
else
swok
=
1
fi
fi
done
if
[
$swok
!=
1
]
then
echo
"<strong><p>"
echo
"ERROR: CMS software initialisation script cmsset_default.sh failed for all architectures"
echo
"</strong></p>"
exit
$SAME_ERROR
fi
echo
"<p>"
echo
"OK"
echo
"</p>"
echo
"<h2>Make sure configuration directory is there</h2>"
echo
"<p>"
echo
"Checking variable:
\$
CMS_PATH=
$CMS_PATH
"
echo
"</p>"
if
[
-z
$CMS_PATH
]
;
then
echo
"<strong><p>"
echo
"ERROR: CMS_PATH not defined"
echo
"</strong></p>"
exit
$SAME_ERROR
fi
if
[
!
-d
$CMS_PATH
]
;
then
echo
"<strong><p>"
echo
"ERROR: CMS_PATH directory
$CMS_PATH
not existing"
echo
"</strong></p>"
exit
$SAME_ERROR
fi
echo
"<p>"
echo
"OK"
echo
"</p>"
echo
"<h2>Check that scramv1 command is present</h2>"
echo
"<pre>"
echo
"scramv1 version"
scramv1 version
result
=
$?
echo
"</pre>"
if
[
$result
!=
0
]
then
echo
"<strong><p>"
echo
"ERROR: scramv1 command not found"
echo
"</strong></p>"
exit
$SAME_ERROR
fi
echo
"<p>"
echo
"OK"
echo
"</p>"
#cd $SAME_SENSOR_WORK
echo
"<h2>Retrieve list of CMSSW versions installed</h2>"
for
arch
in
$archs_defined
do
export
SCRAM_ARCH
=
$arch
export
BUILD_ARCH
=
$arch
echo
"<pre>"
echo
"Architecture:
$arch
"
echo
"scramv1 list -c CMSSW"
scramv1 list
-c
CMSSW
>
scramv1_list_output.txt
listerror
=
$?
echo
"</pre>"
if
[
$listerror
!=
0
]
then
echo
"<p>"
echo
"WARNING: scramv1 list error"
echo
"</p>"
fi
touch
scramv1_list_output.txt
cat
scramv1_list_output.txt |
tr
-s
" "
|
cut
-d
" "
-f2
|
sort
-u
>
cmssw_installed_
${
arch
}
.txt
cat
cmssw_installed_
${
arch
}
.txt
>>
cmssw_installed_version_list.txt
echo
"<ol class=CMSSW-list id=
\"
$arch
\"
>"
if
[
$listerror
==
0
]
# don't try to parse the error message for CMSSW versions
then
cat
cmssw_installed_
${
arch
}
.txt |
while
read
line
do
echo
" <li>"
$line
"</li>"
done
fi
echo
"</ol>"
echo
"<p>"
echo
"OK"
echo
"</p>"
done
echo
"<h2>Verify <a href="
http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/COMP/CMSSAM/SiteTests/testjob/tests/cmssw_required_version_list.txt?view
=
co
">list</a> of required CMSSW versions</h2>"
missing
=
0
failproject
=
0
failrunt
=
0
for
cmsver
in
`
cat
$SAME_SENSOR_HOME
/tests/cmssw_required_version_list.txt
`
do
grep
-x
$cmsver
cmssw_installed_version_list.txt
>
& /dev/null
result
=
$?
if
[
$result
!=
0
]
then
echo
"<p><strong>"
echo
"Required CMSSW version
$cmsver
not installed"
echo
"</strong></p>"
missing
=
1
else
echo
"<p>"
echo
"Checking version
$cmsver
installation"
echo
"</p>"
echo
"<pre>"
# execute in a subprocess commands that require scram
$SAME_SENSOR_HOME
/tests/TestCmsswVersion.sh
$cmsver
TestResult
=
$?
if
[
$TestResult
!=
0
]
then
failproject
=
1
fi
fi
done
echo
"<h2>Verify installed vs. published CMSSW versions</h2>"
# check that installed version list matches published tags
retrieve_published_list_fail
=
0
empty_tag_list
=
0
missing_arch_tag
=
0
missing_version_tag
=
0
missing_published_version
=
0
missing_production_release
=
0
echo
"<p>Try various methods to find CE host name<p>"
if
[
$isEGEE
==
1
]
then
CE
=
`
glite-brokerinfo getCE
`
...
...
@@ -67,9 +273,21 @@ if [ $isOSG == 1 ]
then
CE
=
`
grep
'name.*jobmanager'
.BrokerInfo|cut
-d
'"'
-f2
`
fi
echo
"BrokerInfo reported : "
$CE
"<br>"
echo
"possible env.variables<br>"
echo
"GLITE_WMS_LOG_DESTINATION="
$GLITE_WMS_LOG_DESTINATION
"<br>"
echo
"GLOBUS_CE= "
$GLOBUS_CE
"<br>"
BIH
=
`
ls
-l
$HOME
/.BrokerInfo
`
echo
"BrokerInfo file in HOME="
$BIH
"<br>"
if
[
-z
"
$CE
"
]
;
then
[
-n
$GLITE_WMS_LOG_DESTINATION
]
&&
CE
=
$GLITE_WMS_LOG_DESTINATION
fi
if
[
-z
"
$CE
"
]
;
then
CE
=
$GLOBUS_CE
[
-n
$GLOBUS_CE
]
&&
CE
=
$GLOBUS_CE
fi
if
[
-z
"
$CE
"
]
;
then
echo
"<p>WARNING: Cannot derive CE name. After attempting: <br>"
echo
"<pre>"
...
...
@@ -77,6 +295,7 @@ if [ -z "$CE" ] ; then
glite-brokerinfo getCE
grep
'name.*jobmanager'
.BrokerInfo|cut
-d
'"'
-f2
echo
$GLOBUS_CE
echo
$GLITE_WMS_LOG_DESTINATION
set
+x
echo
"</pre>"
exit
$SAME_WARNING
...
...
@@ -90,116 +309,209 @@ echo "CE is: " $CE
echo
"CE host is: "
$ceHost
echo
"</pre>"
PublishedTagsURL
=
"http://cmsdoc.cern.ch/cms/LCG/SiteComm/published-tags/
$ceHostWithCommas
"
echo
"<p>Retrieve list of published tags from <a href=
\"
$PublishedTagsURL
\"
>
$PublishedTagsURL
</a><br>"
./fetch-from-web
$PublishedTagsURL
publ_tag.txt
rc
=
$?
echo
"rc = "
$rc
[
$rc
==
$SAME_INFO
]
&&
info
=
1
[
$rc
==
$SAME_WARNING
]
&&
warning
=
1
echo
"<h2>Checking a source script for middleware</h2>"
echo
"<p>"
echo
"GLITE_ENV_SET = "
$GLITE_ENV_SET
echo
"RESET PATH"
echo
"<pre>"
set
-x
unset
LD_LIBRARY_PATH
unset
GLITE_ENV_SET
export
PATH
=
/usr/bin:/bin
#source /etc/profile &>/dev/null
set
+x
date
--utc
echo
"List of published tags<br><pre>"
cat
publ_tag.txt
echo
"</pre>"
if
[
$isEGEE
==
1
]
;
then
if
[
-z
$GLITE_WMS_LOCATION
]
;
then
echo
"<h3>"
echo
"ERROR: GLITE_WMS_LOCATION not defined"
echo
"</h3>"
else
echo
"<h3>"
echo
"GLITE_WMS_LOCATION ="
$GLITE_WMS_LOCATION
echo
"</h3>"
filetosource
=
${
GLITE_WMS_LOCATION
}
/etc/profile.d/grid-env.sh
echo
"<pre>"
;
set
-x
ls
-l
${
GLITE_WMS_LOCATION
}
ls
-l
${
GLITE_WMS_LOCATION
}
/etc
ls
-l
${
GLITE_WMS_LOCATION
}
/etc/profile.d
ls
-l
$filetosource
echo
$GLITE_ENV_SET
echo
${
GLITE_ENV_SET
+X
}
echo
X
${
GLITE_ENV_SET
+X
}
set
+x
;
echo
"</pre>"
if
[
-r
"
$filetosource
"
]
;
then
echo
"<pre>"
;
set
-x
date
--utc
source
$filetosource
set
+x
;
echo
"</pre>"
which lcg-ls
>
/dev/null
&&
lcglsOK
=
1
[
$lcglsOK
==
1
]
&&
echo
"<p><strong>lcg-ls found ! as "
`
which lcg-ls
`
"</strong><p>"
if
[
$lcglsOK
==
0
]
;
then
echo
"<pre>"
cat
$filetosource
echo
"</pre>"
fi
fi
fi
date
--utc
if
[
-z
$GLITE_LOCATION
]
;
then
echo
"<h4>"
echo
"GLITE_LOCATION not defined"
echo
"</h4>"
else
if
[
$lcglsOK
==
0
]
;
then
echo
"<p>GLITE_LOCATION ="
$GLITE_LOCATION
filetosource
=
${
GLITE_LOCATION
}
/etc/profile.d/grid-env.sh
echo
"<p>try {GLITE_LOCATION}/etc/profile.d/grid-env.sh"
if
[
-r
"
$filetosource
"
]
;
then
source
"
$filetosource
"
[
-r
`
which lcg-ls
`
]
&&
echo
"<p><strong>lcg-ls found ! as "
`
which lcg-ls
`
"</strong><p>"
which lcg-ls
>
/dev/null
&&
lcglsOK
=
1
fi
filetosource
=
${
GLITE_LOCATION
}
/../etc/profile.d/grid-env.sh
echo
"<p>try {GLITE_LOCATION}/../etc/profile.d/grid-env.sh"
if
[
-r
"
$filetosource
"
]
;
then
source
"
$filetosource
"
[
-r
`
which lcg-ls
`
]
&&
echo
"<p><strong>lcg-ls found ! as "
`
which lcg-ls
`
"</strong><p>"
which lcg-ls
>
/dev/null
&&
lcglsOK
=
1
fi
fi
fi
len
=
`
cat
publ_tag.txt |
wc
--chars
`
if
[
$len
-lt
10
]
then
empty_tag_list
=
1
echo
"<p><br><strong>"
echo
"Suspiciously small (empty ?) tag list returned by lcg-info"
echo
"</p></strong><pre>"
ls
-lh
publ_tag.txt
echo
"</pre>"
fi
date
--utc
if
[
$retrieve_published_list_fail
==
0
]
then
for
arch
in
$archs_to_test
do
if
!
(
grep
-q
$arch
publ_tag.txt
)
then
echo
"<p>ERROR:
$arch
tag missing</p>"
missing_arch_tag
=
1
fi
done
TagCollectorURL
=
"https://cmstags.cern.ch/cgi-bin/CmsTC/ReleasesXML"
echo
"<p>Retrieve list of production version from <a href=
\"
$TagCollectorURL
\"
>
$TagCollectorURL
</a> and ignore releases before 1_5_x<br>"
./fetch-from-web
$TagCollectorURL
ReleasesXML
rc
=
$?
echo
"rc = "
$rc
[
$rc
==
$SAME_INFO
]
&&
info
=
1
[
$rc
==
$SAME_WARNING
]
&&
warning
=
1
if
[
$rc
==
$SAME_OK
-o
$rc
==
$SAME_INFO
]
;
then
cat
ReleasesXML |
grep
Announced|cut
-d
'"'
-f
2|sort
-u
>
production_releases.txt
# do not bother with old SL3-only versions (tags are not maintained)
grep
-v
"CMSSW_0
\|
CMSSW_1_[0-4]"
production_releases.txt
>
newer_releases
mv
newer_releases production_releases.txt
fi
echo
"<h3>If a production releease is installed, it should be published</h3>"
for
cmsver
in
`
cat
cmssw_installed_version_list.txt
`
do
if
(
grep
-qx
$cmsver
production_releases.txt
)
then
if
!
(
grep
-qx
$cmsver
publ_tag.txt
)
then
echo
"<p>"
echo
"WARNING: CMSSW version
$cmsver
installed but not published"
echo
"</p>"
missing_version_tag
=
1
fi
fi
done
[
$missing_version_tag
==
0
]
&&
echo
"OK<p>"
if
[
$isOSG
==
1
]
;
then
if
[
-z
$OSG_GRID
]
;
then
echo
"<h3>"
echo
"ERROR: OSG_GRID not defined"
echo
"</h3>"
else
echo
"OSG_GRID="
$OSG_GRID
echo
"<pre>"
echo
"<h3>If a production release is published, it must be installed</h3>"
for
cmsver
in
`
grep
CMSSW publ_tag.txt
`
do
if
(
grep
-qx
$cmsver
production_releases.txt
)
then
if
!
(
grep
-qx
$cmsver
cmssw_installed_version_list.txt
)
then
echo
"<p>"
echo
"ERROR: CMSSW version
$cmsver
published but not installed"
echo
"<pre>"
set
-x
ls
-l
$OSG_GRID
/setup.sh
cat
publ_tag.txt
cat
production_releases.txt
set
+x
echo
"</pre>"
if
[
-r
"
$OSG_GRID
/setup.sh"
]
;
then
source
"
${
OSG_GRID
}
/setup.sh"
&>/dev/null
[
-x
`
which lcg-ls
`
]
&&
echo
"<p><strong>lcg-ls -X found ! as "
`
which lcg-ls
`
"</strong><p>"
[
-r
`
which lcg-ls
`
]
&&
echo
"<p><strong>lcg-ls -R found ! as "
`
which lcg-ls
`
"</strong><p>"
which lcg-ls
>
/dev/null
&&
lcglsOK
=
1
fi
echo
"</pre>"
echo
"</p>"
missing_published_version
=
1
fi
fi
done
[
$missing_published_version
==
0
]
&&
echo
"OK<p>"
echo
"<h3>All production releases should be installed</h3>"
for
cmsver
in
`
cat
production_releases.txt
`
do
if
!
(
grep
-qx
$cmsver
cmssw_installed_version_list.txt
)
then
echo
"<p>"
echo
"NOTICE: CMSSW production version
$cmsver
not installed"
echo
"</p>"
missing_production_release
=
1
fi
done
[
$missing_production_release
==
0
]
&&
echo
"OK<p>"
fi
if
[
$lcglsOK
==
1
]
;
then
echo
"<h2>"
echo
"OK, lcg-ls is set in the end as"
echo
"</h2>"
echo
"<
pre
>"
which lcg-ls
ls
-l
`
which lcg-ls
`
echo
"
</pre>
"
e
xit
$SAME_OK
# Print out installed Generator Gridpacks
# We assume that they are stored in $CMS_PATH/slc4_ia32_gcc345/generatorData
# SAM test result does not depend on it (at least for now).
echo
"<
h2>Installed Generator Gridpacks</h2
>"
if
[
!
-d
$CMS_PATH
/slc4_ia32_gcc345/generatorData
]
;
then
echo
"<p>"
echo
"
WARNING: No generator data installed!
"
e
cho
"</p>"
else
exit
$SAME_WARNING
cd
$CMS_PATH
/slc4_ia32_gcc345/generatorData
echo
"Following generator data are installed: "
echo
"<pre>"
find
.
-type
d
-mindepth
4
-maxdepth
4
-print
echo
"</pre>"
# Bad permssions - enable later...
# echo "Files or directories with bad permissions"
# find . -type d ! -perm -o+x -print
# find . -type f ! -perm -o+r -print
fi
echo
'<h1><a name="summary"> Test Summary</a></h1><p>'
if
[
$retrieve_published_list_fail
==
1
]
then
echo
"<p>WARNING: Fail to retrieve list of published tags from cmsdoc</p>"
info
=
1
fi
if
[
$missing_production_release
==
1
]
then
echo
"<p>NOTICE: One or more production releases are not installed</p>"
notice
=
1
fi
if
[
$cantwrite
==
1
]
then
echo
"<p>WARNING: Cannot write to CMSSW installation area</p>"
warning
=
1
fi
if
[
$missing
==
1
]
then
echo
"<p>WARNING: Some of the required CMSSW versions not found</p>"
warning
=
1
fi
if
[
$empty_tag_list
==
1
]
then
echo
"<p>WARNING: No CMS tags are published</p>"
warning
=
1
fi
if
[
$missing_version_tag
==
1
]
then
echo
"<p>WARNING: Some CMS VO Tags are missing</p>"
warning
=
1
fi
if
[
$missing_arch_tag
==
1
]
then
echo
"<p>ERROR: Needed CMS VO architecture TAG not published</p>"
error
=
1
fi
if
[
$missing_published_version
==
1
]
then
echo
"<p>ERROR: Some CMSSW version published but not present</p>"
error
=
1
fi
if
[[
$failproject
==
1
||
$failrunt
==
1
]]
then
echo
"<p>Some of the required CMSSW versions not working</p>"
error
=
1
fi
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
[
$notice
==
1
]
then
echo
"<p><strong> NOTE </strong></p>"
exit
$SAME_NOTICE
fi
if
[
$info
==
1
]
then
echo
"<p><strong> INFO </strong></p>"
exit
$SAME_INFO
fi
echo
"<p><strong> OK </strong></p>"
exit
$SAME_OK
Write
Preview
Markdown
is supported
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