All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH 1/2] fstests: generic test setup preamble
Date: Mon, 4 Jun 2018 12:58:51 +1000	[thread overview]
Message-ID: <20180604025851.GD10972@dastard> (raw)
In-Reply-To: <20180603135316.GL6581@desktop>

On Sun, Jun 03, 2018 at 09:53:16PM +0800, Eryu Guan wrote:
> On Tue, May 29, 2018 at 10:47:51AM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > So many tests chop random bits out of the mandaotry test setup
> > preamble which leads to subtle problems and stray files being dumped
> > all over the place. Create a common test preamble with hooks for
> > local cleanup functions so we can prevent this in future.
> > 
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
....

> > --- a/new
> > +++ b/new
> > @@ -181,31 +181,15 @@ cat <<End-of-File >$tdir/$id
> >  #-----------------------------------------------------------------------
> >  #
> >  
> > -seq=\`basename \$0\`
> > -seqres=\$RESULT_DIR/\$seq
> > -echo "QA output created by \$seq"
> > +. common/setup_test
> >  
> > -here=\`pwd\`
> > -tmp=/tmp/\$\$
> > -status=1	# failure is the default!
> > -trap "_cleanup; exit \\\$status" 0 1 2 3 15
> > -
> > -_cleanup()
> > -{
> > -	cd /
> > -	rm -f \$tmp.*
> > -}
> > -
> > -# get standard environment, filters and checks
> > -. ./common/rc
> > -. ./common/filter
> > +# test exit cleanup goes here
> > +local_cleanup() { true }
> 
> Should be just "cleanup" here.

Fixed.

> > diff --git a/tests/xfs/001 b/tests/xfs/001
> > index 2c205f064e2e..1b5a1020e173 100755
> > --- a/tests/xfs/001
> > +++ b/tests/xfs/001
> > @@ -23,44 +23,17 @@
> >  #-----------------------------------------------------------------------
> >  #
> >  
> > -seq=`basename $0`
> > -seqres=$RESULT_DIR/$seq
> > -echo "QA output created by $seq"
> > +. common/setup_test
> >  
> > -here=`pwd`
> > -tmp=/tmp/$$
> > -status=1	# failure is the default!
> > -trap "_cleanup; exit \$status" 0 1 2 3 15
> > -
> > -_cleanup()
> > -{
> > -    cd /
> > -    rm -f $tmp.*
> > +# test exit cleanup goes here
> > +cleanup() {
> > +	rm -rf $TEST_DIR/$$
> >  }
> >  
> > -_do_bit_test()
> 
> Removed by mistake? Test fails without it.

Hmmm - there's a hunk missing from this patch - I moved that
function down further into the test. it's in my current local
version and the test passes just fine. Not sure what went wrong
here...

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-06-04  2:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29  0:47 [RFC PATCH 0/2] fstests: boiler plate reductions Dave Chinner
2018-05-29  0:47 ` [PATCH 1/2] fstests: generic test setup preamble Dave Chinner
2018-06-03 13:53   ` Eryu Guan
2018-06-04  2:58     ` Dave Chinner [this message]
2018-05-29  0:47 ` [PATCH 2/2] fstests: start changeover to spdx license tags Dave Chinner
2018-05-29  2:44 ` [RFC PATCH 0/2] fstests: boiler plate reductions Dave Chinner
2018-06-03 13:51 ` Eryu Guan
2018-06-03 17:55   ` Theodore Y. Ts'o
2018-06-04  2:50   ` Dave Chinner
2018-06-04  3:00     ` Dave Chinner
2018-06-07  5:30       ` Eryu Guan
2018-06-08  6:17         ` Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180604025851.GD10972@dastard \
    --to=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.