From: Dave Chinner <david@fromorbit.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH 5/8] btrfs: convert some tests to new setup preamble
Date: Thu, 28 Jun 2018 00:34:13 +1000 [thread overview]
Message-ID: <20180627143413.GI19934@dastard> (raw)
In-Reply-To: <CAOQ4uxi7NP-NpK38CnBB=epxhq6Ykt+V-hSwOtAJuac7Gwt3og@mail.gmail.com>
On Wed, Jun 27, 2018 at 02:30:13PM +0300, Amir Goldstein wrote:
> On Wed, Jun 27, 2018 at 11:21 AM, Dave Chinner <david@fromorbit.com> wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > Small initial batch to demonstrate conversion.
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
> [...]
> > diff --git a/tests/btrfs/007 b/tests/btrfs/007
> > index 09f2f011bc77..50ead03acf31 100755
> > --- a/tests/btrfs/007
> > +++ b/tests/btrfs/007
> > @@ -9,37 +9,23 @@
> > # (incr) and send both snapshots to a temp file. Remake the file
> > # system and receive from the files. Check both states with fssum.
> > #
> > -# creator
> > -owner=list.btrfs@jan-o-sch.net
> > +. common/setup_test
> >
> > -seq=`basename $0`
> > -seqres=$RESULT_DIR/$seq
> > -echo "QA output created by $seq"
> > +# test exit cleanup goes here
> > +cleanup() { :; }
> >
> > -tmp=`mktemp -d`
> > -status=1
> > -
> > -_cleanup()
> > -{
> > - echo "*** unmount"
> > - _scratch_unmount 2>/dev/null
> > - rm -f $tmp.*
> > -}
>
> Bug in existing test - it does not cleanup $tmp.
Yup, because it creates a non-standard $tmp but then uses code that
assumes that tmp is the standard name prefix definition, not a
directory. This is exactly the sort of bug I'm trying to eradicate.
And, FWIW, because the test is only using tmp files, it doesn't need
to use TEST_DIR to store them so no need for a working directory to
be defined.
> cleanup() { rm -rf $tmp }
>
> -tmp=`mktemp -d`
> +mkdir -p $tmp
Again, no. $tmp is not a directory and there's infrastructure that
assumes it is not a directory.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2018-06-27 14:34 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 8:20 [PATCH 0/6] fstests: start factoring test setup boilerplate Dave Chinner
2018-06-27 8:20 ` [PATCH 1/8] fstests: generic test setup preamble Dave Chinner
2018-06-27 11:07 ` Amir Goldstein
2018-06-27 8:20 ` [PATCH 2/8] tests: convert various test dirs to " Dave Chinner
2018-06-27 10:34 ` Amir Goldstein
2018-06-27 14:03 ` Dave Chinner
2018-06-27 8:20 ` [PATCH 3/8] shared: use new test " Dave Chinner
2018-06-27 10:56 ` Amir Goldstein
2018-06-27 14:27 ` Dave Chinner
2018-06-27 14:43 ` Amir Goldstein
2018-06-27 22:07 ` Dave Chinner
2018-06-28 4:12 ` Amir Goldstein
2018-06-27 8:20 ` [PATCH 4/8] generic: convert some tests to new " Dave Chinner
2018-06-27 11:08 ` Amir Goldstein
2018-07-07 11:28 ` Eryu Guan
2018-06-27 8:21 ` [PATCH 5/8] btrfs: " Dave Chinner
2018-06-27 11:30 ` Amir Goldstein
2018-06-27 14:34 ` Dave Chinner [this message]
2018-06-27 14:48 ` Amir Goldstein
2018-07-07 11:22 ` Eryu Guan
2018-06-27 8:21 ` [PATCH 6/8] ext4: " Dave Chinner
2018-06-27 11:34 ` Amir Goldstein
2018-07-07 11:25 ` Eryu Guan
2018-06-27 8:21 ` [PATCH 7/8] overlay: " Dave Chinner
2018-06-27 11:37 ` Amir Goldstein
2018-06-27 8:21 ` [PATCH 8/8] xfs: " Dave Chinner
2018-06-27 11:42 ` Amir Goldstein
2018-06-28 5:59 ` [PATCH 0/6] fstests: start factoring test setup boilerplate 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=20180627143413.GI19934@dastard \
--to=david@fromorbit.com \
--cc=amir73il@gmail.com \
--cc=fstests@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox