FS/XFS testing framework
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3] xfstests: btrfs: add test case for qgroup account on shared extents
Date: Thu, 18 Dec 2014 11:05:30 +1100	[thread overview]
Message-ID: <20141218000530.GE15665@dastard> (raw)
In-Reply-To: <1418805047-24636-1-git-send-email-bo.li.liu@oracle.com>

On Wed, Dec 17, 2014 at 04:30:47PM +0800, Liu Bo wrote:
> This is a regression test of
> 'commit fcebe4562dec ("Btrfs: rework qgroup accounting")'
> 
> It can produce qgroup related warnings.
> 
> The fix is https://patchwork.kernel.org/patch/5499981/
> "Btrfs: fix a warning of qgroup account on shared extents"
....
> +#! /bin/bash
> +# FS QA Test No. 017
> +#
> +# Regression of 'commit fcebe4562dec ("Btrfs: rework qgroup accounting")',
> +# this will throw a warning into dmesg.
> +#
> +# For more details, the fix is https://patchwork.kernel.org/patch/5499981/
> +# "Btrfs: fix a warning of qgroup account on shared extents"

Please describe the test directly.

> +
> +_need_to_be_root
> +_supported_fs btrfs
> +_supported_os Linux
> +_require_scratch
> +_require_cloner
> +
> +run_check _scratch_mkfs "--nodesize 4096"
> +run_check _scratch_mount

No, please don't use run_check like this.

Errors will end up in the output file, and that will cause the test
to fail.

> +run_check $XFS_IO_PROG -f -d -c "pwrite 0 8K" $SCRATCH_MNT/foo

Same - filter the output, and errors will be verbose and cause a
failure.

> +
> +_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap
> +
> +run_check $CLONER_PROG -s 0 -d 0 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo-reflink
> +run_check $CLONER_PROG -s 0 -d 0 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/snap/foo-reflink
> +run_check $CLONER_PROG -s 0 -d 0 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/snap/foo-reflink2

Filter the output, not "run_check".

If CLONER_PROG is silent when it fails, then it is broken and needs
fixing because users need to know that something failed and they
don't check exit codes.

> +_run_btrfs_util_prog quota enable $SCRATCH_MNT
> +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
> +
> +rm -fr $SCRATCH_MNT/* >/dev/null 2>&1

Don't redirect the output. If an unlink fails, we want to know about
it.

> +_run_btrfs_util_prog filesystem sync $SCRATCH_MNT

What's wrong with "sync"?

> +$BTRFS_UTIL_PROG qgroup show $SCRATCH_MNT | $SED_PROG -n '/[0-9]/p' | $AWK_PROG '{print $2" "$3}'

You can do regex matches with awk.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2014-12-18  0:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16  9:43 [PATCH] xfstests: btrfs/080 add test case for qgroup account on shared extents Liu Bo
2014-12-16 12:10 ` Eryu Guan
2014-12-17  3:12   ` Satoru Takeuchi
2014-12-17  3:38     ` Liu Bo
2014-12-17  3:36   ` Liu Bo
2014-12-17  3:45 ` [PATCH] xfstests: btrfs: " Liu Bo
2014-12-17  3:51 ` [PATCH v2] " Liu Bo
2014-12-17  5:25   ` Eryu Guan
2014-12-17  8:13     ` Liu Bo
2014-12-17  8:24     ` Liu Bo
2014-12-17  8:30 ` [PATCH v3] " Liu Bo
2014-12-17 10:00   ` Satoru Takeuchi
2014-12-18  0:05   ` Dave Chinner [this message]
2014-12-19  8:29     ` Liu Bo
2014-12-19  8:31 ` [PATCH v4] " Liu Bo
2014-12-19  9:21   ` Satoru Takeuchi
2014-12-19  9:29     ` Liu Bo

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=20141218000530.GE15665@dastard \
    --to=david@fromorbit.com \
    --cc=bo.li.liu@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@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