[sheepdog] [PATCH] tests/functional: add a new option for cleaning directories of passed tests

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Aug 22 09:26:04 CEST 2013


At Thu, 22 Aug 2013 16:18:38 +0900,
Hitoshi Mitake wrote:
> 
> Some tests consume lots of disk space and cause disk full (at least on
> my box with 64GB SSD) occasionally. This patch adds a new option -clean-passed
> to the check script. When this option is passed, the script cleans directories
> of passed tests because the directories don't contain interesting data.
> 
> Signed-off-by: Hitoshi Mitake <mitake.hitoshi 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..a7e55c5 100755
> --- a/tests/functional/check
> +++ b/tests/functional/check
> @@ -66,6 +66,7 @@ expunge=true
>  have_test_arg=false
>  randomize=false
>  valgrind=false
> +clean_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
> +    -clean-passed	clean directories of passed tests
>  
>  testlist options
>      -g group[,group...]	include tests from these groups
> @@ -228,6 +230,10 @@ testlist options
>  	    xgroup=true
>  	    xpand=false
>  	    ;;
> +	-clean-passed)
> +	    clean_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 $clean_passed
> +			then
> +			    rm -rf $STORE
> +			fi

How about keeping the directories of the failed tests?  Then I think
cleaning directory should be a default behavior.

Thanks,

Kazutaka



More information about the sheepdog mailing list