From d6c7ca9d30ee573dd4620941a5b5dd1a2a4a6e98 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Mon, 7 Sep 2015 00:24:05 +0530 Subject: tests: Separate logs for each test Change-Id: Ib286e3d4d7c432dab8073fce582ccbf723eb31d2 BUG: 1251592 Signed-off-by: Raghavendra Talur Reviewed-on: http://review.gluster.org/12110 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- tests/include.rc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/include.rc b/tests/include.rc index fb3002d945e..79fbd6c4b0b 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -539,6 +539,20 @@ function cleanup() echo return 1; fi >&2 + + # tar logs at the start and end of every test + if [ -n $LOGDIR ] + then + tarname=$(basename $0 .t) + tar -rvf ${LOGDIR}/${tarname}.tar ${LOGDIR}/* \ + --exclude="*.tar" \ + && \ + find $LOGDIR/* -maxdepth 0 -name '*.tar' -prune \ + -o -exec rm -rf '{}' ';' + else + echo "LOGDIR is not set" + fi + mkdir -p $WORKDIRS # This is usually the last thing a test script calls, so our return # value becomes their exit value. While it's not great for the mkdir -- cgit