Commit 44d0035b authored by Michael Davis's avatar Michael Davis
Browse files

[ci] Adds test for zero-length files

parent df9ed8a7
......@@ -78,8 +78,33 @@ echo "********"
echo "eos root://${EOSINSTANCE} rm /eos/ctaeos/cta/${TEST_FILE_NAME}"
eos root://${EOSINSTANCE} rm /eos/ctaeos/cta/${TEST_FILE_NAME}
#
# Check we can copy zero-length files into the namespace by touch and copy
#
echo "eos root://${EOSINSTANCE} touch /eos/ctaeos/cta/${TEST_FILE_NAME}.touch"
eos root://${EOSINSTANCE} touch /eos/ctaeos/cta/${TEST_FILE_NAME}.touch
echo "eos root://${EOSINSTANCE} cp /eos/ctaeos/cta/${TEST_FILE_NAME}.touch /tmp/${TEST_FILE_NAME}.touch"
eos root://${EOSINSTANCE} cp /eos/ctaeos/cta/${TEST_FILE_NAME}.touch /tmp/${TEST_FILE_NAME}.touch
echo "eos root://${EOSINSTANCE} cp /tmp/${TEST_FILE_NAME}.touch /eos/ctaeos/cta/${TEST_FILE_NAME}.zero"
eos root://${EOSINSTANCE} cp /tmp/${TEST_FILE_NAME}.touch /eos/ctaeos/cta/${TEST_FILE_NAME}.zero
echo "eos root://${EOSINSTANCE} cp /eos/ctaeos/cta/${TEST_FILE_NAME}.zero /tmp/${TEST_FILE_NAME}.zero"
eos root://${EOSINSTANCE} cp /eos/ctaeos/cta/${TEST_FILE_NAME}.zero /tmp/${TEST_FILE_NAME}.zero
if [ -f /tmp/${TEST_FILE_NAME}.touch -a ! -s /tmp/${TEST_FILE_NAME}.touch -a -f /tmp/${TEST_FILE_NAME}.zero -a ! -s /tmp/${TEST_FILE_NAME}.zero ]; then
echo "Zero-length file copy succeeded"
zeroLengthTests=1
else
echo "Zero-length file copy failed"
zeroLengthTests=0
fi
# Clean up
echo "eos root://${EOSINSTANCE} rm /eos/ctaeos/cta/${TEST_FILE_NAME}.touch /eos/ctaeos/cta/${TEST_FILE_NAME}.zero"
eos root://${EOSINSTANCE} rm /eos/ctaeos/cta/${TEST_FILE_NAME}.touch /eos/ctaeos/cta/${TEST_FILE_NAME}.zero
rm -f /tmp/${TEST_FILE_NAME}.touch /tmp/${TEST_FILE_NAME}.zero
# Report results
msgNum=$(grep "\"File suc" /mnt/logs/tpsrv*/taped/cta/cta-taped.log | grep ${TEST_FILE_NAME} | tail -n 4 | wc -l)
if [ $msgNum == "4" ]; then
if [ "$msgNum" = "4" -a $zeroLengthTests -eq 1 ]; then
echo "OK: all tests passed"
rc=0
else
......
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