[sheepdog] [PATCH v3 3/4] test: add new option -c for correcting logs
Hitoshi Mitake
mitake.hitoshi at lab.ntt.co.jp
Tue Feb 5 05:40:54 CET 2013
From: Hitoshi Mitake <mitake.hitoshi at gmail.com>
If -c is passed, check will correct logs produced by sheeps in the
directory tests/logs/ after completion of tests.
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
v3
* collect log files unconditionally
* name of a directory for storing log files is determined by `date
+%Y-%m-%d-%H-%M-%S`, for avoiding accidental overwriting
8<---
tests/check | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/tests/check b/tests/check
index 9f47aeb..0ad4ff0 100755
--- a/tests/check
+++ b/tests/check
@@ -145,7 +145,7 @@ check options
-n show me, do not run tests
-T output timestamps
-r randomize test order
-
+
testlist options
-g group[,group...] include tests from these groups
-x group[,group...] exclude tests from these groups
@@ -523,6 +523,22 @@ do
seq="after_$seq"
done
+# correct log files
+log_dir=logs.`date +%Y-%m-%d-%H-%M-%S`
+
+if [ ! -d $log_dir ]
+then
+ mkdir $log_dir
+
+ for f in `find $STORE -name sheep.log`;
+ do
+ cp $f $log_dir
+ done
+else
+ echo "directory $log_dir already exists"
+ echo "skip assembling log files"
+fi
+
interrupt=false
status=`expr $n_bad`
exit
--
1.7.2.5
More information about the sheepdog
mailing list