vpp/test/scripts/compress_failed.sh
Klement Sekera f413bef135 make test: collect symlinks to failed tests
Compress files in temporary directories of failed tests and symlink
the directories under /tmp/vpp-failed-unittests location - preparation
for jenkins archivation. Automatically cleanup the directory at start
of test run.

The compression is performed only when environment variable
COMPRESS_FAILED_TEST_LOGS is set to one of "yes", "y", "1".
This is set in verify target, but left unset by default, so when
invoking make test by hand, files won't be compressed.

Change-Id: I84c8f1c6aa79aa9c0b753357022b1f195f17a283
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-08-17 14:44:05 +00:00

22 lines
538 B
Bash
Executable File

#!/bin/bash
if [ "$(ls -A ${VPP_TEST_FAILED_DIR})" ]
then
if [ "${COMPRESS_FAILED_TEST_LOGS}" == "yes" ]
then
echo -n "Compressing files in temporary directories from failed test runs..."
cd ${VPP_TEST_FAILED_DIR}
for d in *
do
cd ${d}
find . ! -path . -print0 | xargs -0 -n1 gzip
cd ${VPP_TEST_FAILED_DIR}
done
echo "done."
else
echo "Not compressing files in temporary directories from failed test runs."
fi
else
echo "No symlinks to failed tests' temporary directories found in ${VPP_TEST_FAILED_DIR}."
fi