From: Dave Chinner <david@fromorbit.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH 3/8] shared: use new test setup preamble
Date: Thu, 28 Jun 2018 00:27:45 +1000 [thread overview]
Message-ID: <20180627142745.GH19934@dastard> (raw)
In-Reply-To: <CAOQ4uxj90rifsdgi67aMnqGzzX5P+oNQz_kRnpF73+wTjuq9kA@mail.gmail.com>
On Wed, Jun 27, 2018 at 01:56:29PM +0300, Amir Goldstein wrote:
> On Wed, Jun 27, 2018 at 11:20 AM, Dave Chinner <david@fromorbit.com> wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
> [...]
> > diff --git a/tests/shared/298 b/tests/shared/298
> > index e7b7b233de45..fc2d090a2f66 100755
> > --- a/tests/shared/298
> > +++ b/tests/shared/298
> > @@ -6,15 +6,22 @@
> > #
> > # Test that filesystem sends discard requests only on free blocks
> > #
> > -seq=`basename $0`
> > -seqres=$RESULT_DIR/$seq
> > -echo "QA output created by $seq"
> > +. common/setup_test
> >
> > -status=1 # failure is the default!
> > -trap "_cleanup; exit \$status" 0 1 2 3 15
> > +# test exit cleanup goes here
> > +cleanup() {
> > + $UMOUNT_PROG $loop_dev &> /dev/null
> > + _destroy_loop_device $loop_dev
> > + if [ $status -eq 0 ]; then
> > + rm $img_file
> > + rm -rf $workdir
> > + fi
> > +}
> >
> > -. ./common/rc
> > +# remove previous $seqres.full before test
> > +rm -f $seqres.full
> >
> > +# include test specific environments here
> > _supported_fs ext4 xfs
> > _supported_os Linux
> > _require_test
> > @@ -24,15 +31,8 @@ _require_xfs_io_command "fiemap"
> > _require_fs_space $TEST_DIR 307200
> > [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
> >
> > -_cleanup()
> > -{
> > - $UMOUNT_PROG $loop_dev &> /dev/null
> > - _destroy_loop_device $loop_dev
> > - if [ $status -eq 0 ]; then
> > - rm -rf $tmp
> > - rm $img_file
> > - fi
> > -}
> > +workdir=$TEST_DIR/$$
> > +mkdir -p $workdir
>
> :-/ I don't like this s/tmp/workdir conversion and don't like the idea
> of having to do the same thing for 16 btrfs tests + 1 generic test.
Too bad, we're going to have to do that.
> IIUC, you changed the test from using tmpdir under $here to
> tmpdir under $TEST_DIR.
Yes, because the usages of $tmp in this test (and all those other
ones, too) is completely broken. You do realise that $here points
at the xfstests source directory, and so tests like this are dumping
crap in the source dir you run xfstests out of?
That's the sort of crap I'm trying to get rid of by moving to a
common setup - no test should *ever* be writing to $here. They
write temporary files the test needs to either /tmp
(i.e. $tmp) or TEST_DIR. Redfining $tmp to whatever you want
breaks assumptions in the infrastructure, and that's precisely the
problems I'm trying to fix.
And that means we've got to do the hard work of fixing the crappy
tests that have accumulated over the years. The btrfs stuff is
simple to fix - there's 15+ years of technical debt in the old xfs
and generic tests that I'm going to have to wade through to make
this conversion work. I don't like having to do this but if we want
to make things better then we have to fix them.
> Why not change it to tmpdir under /tmp?
> Only change you will need to do is:
> -tmp=`mktemp -d`
> +mkdir -p $tmp
Because the test is creating image files in $tmp, and we've had
problems in the past with tests running the root filesystems out of
space because they put too much shit in /tmp or dump crap in $here.
TEST_DIR is supposed to be used at the work dir for things like this
- we're trying to exercises the filesystem we are testing, not the
root filesystem that hosts the fstests installation.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2018-06-27 14:27 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 [this message]
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
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=20180627142745.GH19934@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