dmwm/WMCore — pull request #4222 by dballesteros7 (2012-10-27 04:50:26+00:00)
Title: Implement checksums in LCGImpl backend module

Add support for verifying the adler32 checksum when available
through the lcg-ls -l command. Also add general support
for passing the locally calculated checksums of the files
to the StageOutImpl objects, this will enable the checksum
verification in the rfcp-CERN backend plugin as well.

For the LCGImpl plugin the checksum is obtained as follows:

echo "$LCG_OUTPUT" | sed -nr 's/^.*\s([a-f0-9]{8})\s*\([aA][dD][lL][eE][rR]32\)\s*$/\\1/p'

Where LCG_OUTPUT=`lcg-ls -l -b -D srmv2 2>/dev/null`

The expected format of LCG_OUTPUT is a multi-line string where one of the lines has the following format:

* Checksum: <8-hex character string> (ADLER32)

Or

* Checksum: <8-hex character string> (adler32)

If this line is not present then it is assumed that the checksum is not supported and the check is skipped,
but if a checksum is present then it will be compared and will fail with exit code 63011 if it doesn't match.
Error code is the same as for size mismatch.

Fixes #4185

Tested on all 4 T1s using the srmv2-lcg stageout command, and therefore the LCGImpl backend module, works even in CNAF which doesn't give a checksum yet.