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

Hitoshi Mitake mitake.hitoshi at gmail.com
Thu Aug 22 10:38:46 CEST 2013


At Thu, 22 Aug 2013 16:36:55 +0800,
Liu Yuan wrote:
> 
> On Thu, Aug 22, 2013 at 05:30:20PM +0900, Hitoshi Mitake wrote:
> > At Thu, 22 Aug 2013 16:26:04 +0900,
> > MORITA Kazutaka wrote:
> > > 
> > > 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.
> > 
> > Looks good. I'll change -clean-passed to -keep-passed.
> 
> I think we should always clean-passed. No one will try keep-passed.

I think -keep-passed will be useful for checking correctness of tests
themselves.

Thanks,
Hitoshi



More information about the sheepdog mailing list