FSTests Archive on lore.kernel.org
 help / color / Atom feed
From: Filipe Manana <fdmanana@gmail.com>
To: Chengguang Xu <cgxu519@mykernel.net>
Cc: Eryu Guan <guaneryu@gmail.com>, fstests <fstests@vger.kernel.org>,
	linux-unionfs@vger.kernel.org
Subject: Re: [PATCH v2] generic/597: test data integrity for rdonly remount
Date: Wed, 20 May 2020 16:09:23 +0100
Message-ID: <CAL3q7H4aObeXLuhv05AOyrLU1B_3M81y_ddH1cY0pAEEEO+Law@mail.gmail.com> (raw)
In-Reply-To: <20200519080929.18030-1-cgxu519@mykernel.net>

On Tue, May 19, 2020 at 9:10 AM Chengguang Xu <cgxu519@mykernel.net> wrote:
>
> This test checks data integrity when remounting from
> rw to ro mode.
>
> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
> ---
> v1->v2:
> - Add to shutdown greoup.
> - Change case number to 597
>
>  tests/generic/597     | 54 +++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/597.out |  2 ++
>  tests/generic/group   |  1 +
>  3 files changed, 57 insertions(+)
>  create mode 100755 tests/generic/597
>  create mode 100644 tests/generic/597.out
>
> diff --git a/tests/generic/597 b/tests/generic/597
> new file mode 100755
> index 00000000..d96e750b
> --- /dev/null
> +++ b/tests/generic/597
> @@ -0,0 +1,54 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2020 Chengguang Xu <cgxu519@mykernel.net>.
> +# All Rights Reserved.
> +#
> +# FS QA Test 597
> +#
> +# Test data integrity for ro remount.
> +#
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=0
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +       cd /
> +       rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +_supported_fs generic
> +_supported_os Linux
> +_require_fssum
> +_require_scratch
> +_require_scratch_shutdown

Couldn't the test be using dm's flakey instead of shutdown?
As shutdown is not implemented by all filesystems (btrfs for example),
it would allow more coverage.

Thanks.

> +
> +_scratch_mkfs &>/dev/null
> +_scratch_mount
> +
> +localdir=$SCRATCH_MNT/dir
> +mkdir $localdir
> +sync
> +
> +# fssum used for comparing checksum of test file(data & metedata),
> +# exclude checking about atime, block structure, open error.
> +$FSSUM_PROG -ugomAcdES -f -w $tmp.fssum $localdir
> +_scratch_remount ro
> +_scratch_shutdown
> +_scratch_cycle_mount
> +$FSSUM_PROG -r $tmp.fssum $localdir
> +
> +exit
> diff --git a/tests/generic/597.out b/tests/generic/597.out
> new file mode 100644
> index 00000000..a847cfe2
> --- /dev/null
> +++ b/tests/generic/597.out
> @@ -0,0 +1,2 @@
> +QA output created by 597
> +OK
> diff --git a/tests/generic/group b/tests/generic/group
> index e82004e8..d68fee9a 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -599,3 +599,4 @@
>  594 auto quick quota
>  595 auto quick encrypt
>  596 auto quick
> +597 auto quick remount shutdown
> --
> 2.20.1
>
>


-- 
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  8:09 Chengguang Xu
2020-05-20 15:09 ` Filipe Manana [this message]
2020-05-25  2:17   ` cgxu
2020-05-25  3:40     ` Amir Goldstein

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=CAL3q7H4aObeXLuhv05AOyrLU1B_3M81y_ddH1cY0pAEEEO+Law@mail.gmail.com \
    --to=fdmanana@gmail.com \
    --cc=cgxu519@mykernel.net \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-unionfs@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

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git