#!/bin/sh info=0 notice=0 warning=0 error=0 isEGEE=0 isOSG=0 export LANG=C cat $SAME_SENSOR_HOME/tests/CMS-SAM-Banner.html echo '
" echo "version 25-03-2010 17: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 . cp -v $SAME_SENSOR_HOME/tests/fetch-from-web . cp -v $SAME_HOME/.BrokerInfo . [ -n "$GLITE_WMS_RB_BROKERINFO" ] && cp -v $GLITE_WMS_RB_BROKERINFO . [ -n "$EDG_WL_RB_BROKERINFO" ] && cp -v $EDG_WL_RB_BROKERINFO . echo "" echo "Memory:" echo "
" cat /proc/meminfo echo "" echo "
" echo "
" if [ -n "$OSG_APP" ] ; then isOSG=1 SW_DIR=$OSG_APP/cmssoft/cms echo "Checking variable: \$OSG_APP/cmssoft/cms=$OSG_APP/cmssoft/cms" echo "
" elif [ -n "$VO_CMS_SW_DIR" ] ; then isEGEE=1 SW_DIR=$VO_CMS_SW_DIR echo "Checking variable: \$VO_CMS_SW_DIR=$VO_CMS_SW_DIR" echo "" else echo "" echo "ERROR: Neither VO_CMS_SW_DIR nor OSG_APP defined" echo "" exit $SAME_ERROR fi echo "" ls -ld $SW_DIR result=$? echo "" echo if [ $result != 0 ] then echo "
" echo "ERROR: software $SW_DIR directory non existent or non readable" echo "
" # echo "summary: NO_SW_DIR" exit $SAME_ERROR fi echo "" if [ -x $SW_DIR/common/cmsos ]; then echo -n "cmsos reports: " $SW_DIR/common/cmsos fi if [ -x $SW_DIR/common/cmsarch ]; then echo -n "cmsarch reports: " $SW_DIR/common/cmsarch fi echo "" echo "
" touch $SW_DIR/.sametest result=$? echo "" if [ $result != 0 ] then cantwrite=1 echo "WARNING: cannot write to software area" fi fi if [ ! -f $SW_DIR/cmsset_default.sh ] ; then echo "
" echo "source $SW_DIR/cmsset_default.sh" echo "" archs_defined='slc4_ia32_gcc345 slc5_ia32_gcc434 slc5_amd64_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 "
" echo "Testing with SCRAM_ARCH=$arch ..." echo "
" echo "" rm -f cmsset.log source $SW_DIR/cmsset_default.sh > cmsset.log 2>&1 result=$? cat cmsset.log echo "" 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 "
" echo "WARNING: CMS software initialisation script cmsset_default.sh failed for SCRAM_ARCH=$arch" echo "
" else swok=1 fi fi done if [ $swok != 1 ] then echo "" echo "ERROR: CMS software initialisation script cmsset_default.sh failed for all architectures" echo "
" exit $SAME_ERROR fi echo "" echo "OK" echo "
" echo "" echo "Checking variable: \$CMS_PATH=$CMS_PATH" echo "
" if [ -z $CMS_PATH ]; then echo "" echo "ERROR: CMS_PATH not defined" echo "
" exit $SAME_ERROR fi if [ ! -d $CMS_PATH ] ; then echo "" echo "ERROR: CMS_PATH directory $CMS_PATH not existing" echo "
" exit $SAME_ERROR fi echo "" echo "OK" echo "
" echo "" echo "scramv1 version" scramv1 version result=$? echo "" if [ $result != 0 ] then echo "
" echo "ERROR: scramv1 command not found" echo "
" exit $SAME_ERROR fi echo "" echo "OK" echo "
" #cd $SAME_SENSOR_WORK echo "" echo "Architecture: $arch" echo "scramv1 list -c CMSSW" scramv1 list -c CMSSW > scramv1_list_output.txt listerror=$? echo "" if [ $listerror != 0 ] then echo "
" echo "WARNING: scramv1 list error" echo "
" 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 "" echo "OK" echo "
" done echo "" echo "Required CMSSW version $cmsver not installed" echo "
" missing=1 else echo "" echo "Checking version $cmsver installation" echo "
" echo "" # execute in a subprocess commands that require scram $SAME_SENSOR_HOME/tests/TestCmsswVersion.sh $cmsver TestResult=$? if [ $TestResult != 0 ] then failproject=1 fi echo "" fi done echo "
Try various methods to find CE host name
"
if [ $isEGEE == 1 ]
then
CE=`glite-brokerinfo getCE`
fi
if [ $isOSG == 1 ]
then
CE=`grep 'name.*jobmanager' .BrokerInfo|cut -d'"' -f2`
fi
echo "BrokerInfo reported : " $CE "
"
echo "possible env.variables
"
echo "GLITE_WMS_LOG_DESTINATION=" $GLITE_WMS_LOG_DESTINATION "
"
echo "GLOBUS_CE= " $GLOBUS_CE "
"
BIH=`ls -l $SAME_HOME/.BrokerInfo 2>&1`
echo "BrokerInfo file in SAME_HOME=" $BIH "
"
if [ -z "$CE" ] ; then
[ -n $GLITE_WMS_LOG_DESTINATION ] && CE=$GLITE_WMS_LOG_DESTINATION
fi
if [ -z "$CE" ] ; then
[ -n $GLOBUS_CE ] && CE=$GLOBUS_CE
fi
if [ -z "$CE" ] ; then
echo "
WARNING: Cannot derive CE name. After attempting:
"
echo "
" set -x glite-brokerinfo getCE grep 'name.*jobmanager' .BrokerInfo|cut -d'"' -f2 echo $GLOBUS_CE echo $GLITE_WMS_LOG_DESTINATION set +x echo "" exit $SAME_WARNING fi ceHost=`echo $CE|cut -d':' -f1` ceHostWithCommas=`echo $ceHost|tr . ,` echo "
" echo "CE is: " $CE echo "CE host is: " $ceHost echo "" PublishedTagsURL="http://cmsdoc.cern.ch/cms/LCG/SiteComm/published-tags/$ceHostWithCommas" echo "
Retrieve list of published tags from $PublishedTagsURL
"
./fetch-from-web $PublishedTagsURL publ_tag.txt
rc=$?
echo "rc from fetch-from-web = " $rc
[ $rc == $SAME_INFO ] && info=1
[ $rc == $SAME_NOTICE ] && note=1
[ $rc == $SAME_NOTICE ] && retrieve_published_list_fail=1
echo "List of published tags
" cat publ_tag.txt echo "" if [ $retrieve_published_list_fail == 0 ] then len=`cat publ_tag.txt | wc --chars` if [ $len -lt 10 ] then empty_tag_list=1 echo "
"
echo "Suspiciously small (empty ?) tag list returned by lcg-info"
echo "
" ls -lh publ_tag.txt echo "" retrieve_published_list_fail=1 note=1 fi fi if [ $retrieve_published_list_fail == 0 ] then for arch in $archs_to_test do if ! (grep -q $arch publ_tag.txt) then echo "
ERROR: $arch tag missing
" missing_arch_tag=1 fi done TagCollectorURL="https://cmstags.cern.ch/cgi-bin/CmsTC/ReleasesXML" echo "Retrieve list of production version from $TagCollectorURL and ignore releases before 1_5_x
"
./fetch-from-web $TagCollectorURL ReleasesXML
rc=$?
echo "rc = " $rc
[ $rc == $SAME_INFO ] && info=1
if [ $rc == $SAME_NOTICE ]
then
note=1
echo "
NOTICE: Fail to retrieve list of production versions from TagCollector/p>" fi 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 "
" echo "WARNING: CMSSW version $cmsver installed but not published" echo "
" missing_version_tag=1 fi fi done [ $missing_version_tag == 0 ] && echo "OK" echo "
" echo "ERROR: CMSSW version $cmsver published but not installed" echo "
" set -x cat publ_tag.txt cat production_releases.txt set +x echo "" echo "" missing_published_version=1 fi fi done [ $missing_published_version == 0 ] && echo "OK
" echo "
" echo "NOTICE: CMSSW production version $cmsver not installed" echo "
" missing_production_release=1 fi done [ $missing_production_release == 0 ] && echo "OK" fi if [ $isEGEE == 1 ] ; then # Determine shared software area echo "
" echo " WARNING: No generator data installed!" echo "
" else cd $CMS_PATH/slc4_ia32_gcc345/generatorData echo "Following generator data are installed: " echo "" find . -type d -mindepth 4 -maxdepth 4 -print echo "" # 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 "
" echo -n "SL4 RPM: " rpm -qa | grep cms-common echo "" if [ -d $SW_DIR/slc5_ia32_gcc434 ]; then APTINIT=`find $SW_DIR/slc5_ia32_gcc434/external/apt -name init.sh` source $APTINIT echo "
" echo -n "SL5 RPM: " rpm -qa | grep cms-common echo "" fi echo '
' if [ $retrieve_published_list_fail == 1 ] then echo "
NOTICE: Fail to retrieve list of published tags from cmsdoc
" note=1 fi if [ $missing_production_release == 1 ] then echo "NOTICE: One or more production releases are not installed
" notice=1 fi if [ $cantwrite == 1 ] then echo "WARNING: Cannot write to CMSSW installation area
" warning=1 fi if [ $missing == 1 ] then echo "WARNING: Some of the required CMSSW versions not found
" warning=1 fi if [ $empty_tag_list == 1 ] then echo "WARNING: No CMS tags are published
" warning=1 fi if [ $missing_version_tag == 1 ] then echo "WARNING: Some CMS VO Tags are missing
" warning=1 fi if [ $missing_arch_tag == 1 ] then echo "ERROR: Needed CMS VO architecture TAG not published
" error=1 fi if [ $missing_published_version == 1 ] then echo "ERROR: Some CMSSW version published but not present
" error=1 fi if [[ $failproject == 1 || $failrunt == 1 ]] then echo "Some of the required CMSSW versions not working
" error=1 fi if [[ $error == 1 ]] then echo "ERROR
" exit $SAME_ERROR fi if [[ $warning == 1 ]] then echo "WARNING
" exit $SAME_WARNING fi if [ $notice == 1 ] then echo "NOTE
" exit $SAME_NOTICE fi if [ $info == 1 ] then echo "INFO
" exit $SAME_INFO fi echo "OK
" exit $SAME_OK