[sheepdog] [PATCH stable-0.7 2/2] tests/functional: let check clean directories of passed tests in default

Hitoshi Mitake mitake.hitoshi at gmail.com
Mon Aug 26 16:43:11 CEST 2013


From: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>

Some tests consume lots of disk space and cause disk full (at least on
my box with 64GB SSD). This patch lets the check script clean
directories of passed tests in default. In addition, this patch adds a
new option -keep-passed. When this option is passed, the script keeps
directories of passed tests. This would be useful when we need to
check correctness of test scriptes themselves.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/functional/check | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/functional/check b/tests/functional/check
index e7b7a17..9fee2ef 100755
--- a/tests/functional/check
+++ b/tests/functional/check
@@ -66,6 +66,7 @@ expunge=true
 have_test_arg=false
 randomize=false
 valgrind=false
+keep_passed=false
 
 rm -f $tmp.list $tmp.tmp $tmp.sed
 
@@ -150,6 +151,7 @@ check options
     -n			show me, do not run tests
     -T			output timestamps
     -r 			randomize test order
+    -keep-passed	keep directories of passed tests
 
 testlist options
     -g group[,group...]	include tests from these groups
@@ -228,6 +230,10 @@ testlist options
 	    xgroup=true
 	    xpand=false
 	    ;;
+	-keep-passed)
+	    keep_passed=true
+	    xpand=false
+	    ;;
 	'[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
 	    echo "No tests?"
 	    status=1
@@ -510,6 +516,10 @@ do
 			:
 		    else
 			echo "$seq `expr $stop - $start`" >>$tmp.time
+			if ! $keep_passed
+			then
+			    rm -rf $STORE
+			fi
 		    fi
 		else
 		    echo " - output mismatch (see $seq.out.bad)"
-- 
1.8.1.2




More information about the sheepdog mailing list