linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 10/12] xfs: test xfs_copy and xfs_mdrestore on the populate images
Date: Sat, 23 Mar 2019 23:32:52 -0700	[thread overview]
Message-ID: <20190324063252.GA6537@magnolia> (raw)
In-Reply-To: <20190324023653.GX2824@desktop>

On Sun, Mar 24, 2019 at 10:36:53AM +0800, Eryu Guan wrote:
> On Tue, Mar 19, 2019 at 05:45:49PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Make sure that copy, metadump, and mdrestore work on a filesystem with
> > all known metadata types.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  tests/xfs/740     |   97 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  tests/xfs/740.out |   12 +++++++
> >  tests/xfs/group   |    1 +
> >  3 files changed, 110 insertions(+)
> >  create mode 100755 tests/xfs/740
> >  create mode 100644 tests/xfs/740.out
> > 
> > 
> > diff --git a/tests/xfs/740 b/tests/xfs/740
> > new file mode 100755
> > index 00000000..0ff548cb
> > --- /dev/null
> > +++ b/tests/xfs/740
> > @@ -0,0 +1,97 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0+
> > +# Copyright (c) 2019 Oracle, Inc.  All Rights Reserved.
> > +#
> > +# FS QA Test No. 740
> > +#
> > +# Populate a XFS filesystem and ensure that metadump, mdrestore, and copy
> > +# all work properly.
> > +#
> > +seq=`basename $0`
> > +seqres=$RESULT_DIR/$seq
> > +echo "QA output created by $seq"
> > +
> > +here=`pwd`
> > +tmp=/tmp/$$
> > +status=1	# failure is the default!
> > +trap "_cleanup; exit \$status" 0 1 2 3 7 15
> > +
> > +_cleanup()
> > +{
> > +	cd /
> > +	rm -rf $tmp.* $testdir
> > +}
> > +
> > +# get standard environment, filters and checks
> > +. ./common/rc
> > +. ./common/filter
> > +. ./common/populate
> > +
> > +testdir=$TEST_DIR/test-$seq
> > +
> > +# real QA test starts here
> > +_supported_os Linux
> > +_supported_fs xfs
> > +
> > +_require_scratch_nocheck
> > +_require_populate_commands
> > +
> > +echo "Format and populate"
> > +_scratch_populate_cached nofill > $seqres.full 2>&1
> > +
> > +mkdir -p $testdir
> > +metadump_file=$testdir/scratch.md
> > +metadump_file_a=${metadump_file}.a
> > +metadump_file_g=${metadump_file}.g
> > +metadump_file_ag=${metadump_file}.ag
> > +copy_file=$testdir/copy.img
> > +
> > +echo metadump
> > +_scratch_metadump $metadump_file
> > +
> > +echo metadump a
> > +_scratch_metadump $metadump_file_a
> > +
> > +echo metadump g
> > +_scratch_metadump $metadump_file_g
> > +
> > +echo metadump ag
> > +_scratch_metadump $metadump_file_ag
> 
> I may miss something here, but I'm a bit confused, what's the difference
> between all these metadump files? Looks like scratch device is just
> dumped multiple times to different dump files? And later restored
> multiple times?

Bah, that was *supposed* to be a test of the different flavors of
metadump (copy entire blocks or not; obfuscate names or not) but clearly
I thinko'd the metadump commands. :(

Where is this AI programming future where I can simply express a desire
to test all the major format-altering metadump variants and the computer
will figure out what needs to be done, rather than me having to write
that idea in triplicate in the form of a log message, a file name, and a
command line switch?

It's times like these I really hate programming. <grumble>

--D

> Thanks,
> Eryu
> 
> > +
> > +echo copy
> > +$XFS_COPY_PROG $SCRATCH_DEV $copy_file >> $seqres.full
> > +_check_scratch_fs $copy_file
> > +
> > +echo recopy
> > +$XFS_COPY_PROG $copy_file $SCRATCH_DEV >> $seqres.full
> > +_scratch_mount
> > +_check_scratch_fs
> > +_scratch_unmount
> > +
> > +echo mdrestore
> > +xfs_mdrestore $metadump_file $SCRATCH_DEV
> > +_scratch_mount
> > +_check_scratch_fs
> > +_scratch_unmount
> > +
> > +echo mdrestore a
> > +xfs_mdrestore $metadump_file_a $SCRATCH_DEV
> > +_scratch_mount
> > +_check_scratch_fs
> > +_scratch_unmount
> > +
> > +echo mdrestore g
> > +xfs_mdrestore $metadump_file_g $SCRATCH_DEV
> > +_scratch_mount
> > +_check_scratch_fs
> > +_scratch_unmount
> > +
> > +echo mdrestore ag
> > +xfs_mdrestore $metadump_file_ag $SCRATCH_DEV
> > +_scratch_mount
> > +_check_scratch_fs
> > +_scratch_unmount
> > +
> > +# success, all done
> > +status=0
> > +exit
> > diff --git a/tests/xfs/740.out b/tests/xfs/740.out
> > new file mode 100644
> > index 00000000..0c979dc4
> > --- /dev/null
> > +++ b/tests/xfs/740.out
> > @@ -0,0 +1,12 @@
> > +QA output created by 740
> > +Format and populate
> > +metadump
> > +metadump a
> > +metadump g
> > +metadump ag
> > +copy
> > +recopy
> > +mdrestore
> > +mdrestore a
> > +mdrestore g
> > +mdrestore ag
> > diff --git a/tests/xfs/group b/tests/xfs/group
> > index 9d9458b8..b8bd1012 100644
> > --- a/tests/xfs/group
> > +++ b/tests/xfs/group
> > @@ -500,3 +500,4 @@
> >  500 auto quick mkfs prealloc mkfs
> >  501 auto quick unlink
> >  502 auto quick unlink
> > +740 auto copy metadump
> > 

  reply	other threads:[~2019-03-24  6:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20  0:44 [PATCH 00/12] fstests: various fixes Darrick J. Wong
2019-03-20  0:44 ` [PATCH 01/12] check: improve test list randomization Darrick J. Wong
2019-03-20  0:44 ` [PATCH 02/12] check: really " Darrick J. Wong
2019-03-20  0:44 ` [PATCH 03/12] generic/042: fix stale disk contents check Darrick J. Wong
2019-03-20  0:45 ` [PATCH 04/12] generic/032: fix unwritten extent checks Darrick J. Wong
2019-03-20  0:45 ` [PATCH 05/12] generic/454: stop the test if we run out of space Darrick J. Wong
2019-03-20  0:45 ` [PATCH 06/12] ext4/023: don't require scrub for ext4 populated image creation Darrick J. Wong
2019-03-20  0:45 ` [PATCH 07/12] common/populate: refactor _scratch_populate_cached Darrick J. Wong
2019-03-20  0:45 ` [PATCH 08/12] common/populate: support multiple cached images Darrick J. Wong
2019-03-20  0:45 ` [PATCH 09/12] clonerange: test remapping the rainbow Darrick J. Wong
2019-03-20  0:45 ` [PATCH 10/12] xfs: test xfs_copy and xfs_mdrestore on the populate images Darrick J. Wong
2019-03-24  2:36   ` Eryu Guan
2019-03-24  6:32     ` Darrick J. Wong [this message]
2019-03-24  6:48   ` [PATCH v2 " Darrick J. Wong
2019-03-20  0:45 ` [PATCH 11/12] check: wipe scratch devices between tests Darrick J. Wong
2019-03-20  7:06   ` Amir Goldstein
2019-03-21  4:15     ` Darrick J. Wong
2019-03-23 13:29       ` Eryu Guan
2019-03-25 23:48         ` Darrick J. Wong
2019-03-26 16:24           ` Amir Goldstein
2019-03-20  0:46 ` [PATCH 12/12] misc: fix broken _require_scratch usage Darrick J. Wong

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=20190324063252.GA6537@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@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;
as well as URLs for NNTP newsgroup(s).