public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "zhangyi (F)" <yi.zhang@huawei.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <linux-unionfs@vger.kernel.org>,
	fstests <fstests@vger.kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>, Eryu Guan <eguan@redhat.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	Miao Xie <miaoxie@huawei.com>
Subject: Re: [PATCH for xfstests 2/4] overlay: add fsck.overlay whiteout test
Date: Fri, 15 Dec 2017 13:35:08 +0800	[thread overview]
Message-ID: <380c648b-06b7-7afa-ef16-42e2d2d7ea7f@huawei.com> (raw)
In-Reply-To: <CAOQ4uxihAUTTP4nrtYxgNmqScmh80GTnDgJmmNFMsvj3Y4Y7ZA@mail.gmail.com>

On 2017/12/14 21:13, Amir Goldstein Wrote:
> On Thu, Dec 14, 2017 at 8:48 AM, zhangyi (F) <yi.zhang@huawei.com> wrote:
>> Add fsck.overlay test case to test it how to deal with orphan/valid
>> whiteouts in underlying directories of overlayfs.
>>
>> Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
>> ---
>>  tests/overlay/201     | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>  tests/overlay/201.out |  3 ++
>>  tests/overlay/group   |  1 +
>>  3 files changed, 102 insertions(+)
>>  create mode 100755 tests/overlay/201
>>  create mode 100644 tests/overlay/201.out
>>
[..]
>> +# Create test directories
>> +lowerdir=$OVL_BASE_SCRATCH_MNT/lower
>> +lowerdir2=$OVL_BASE_SCRATCH_MNT/lower2
>> +upperdir=$OVL_BASE_SCRATCH_MNT/upper
>> +workdir=$OVL_BASE_SCRATCH_MNT/workdir
>> +
>> +mkdir -p $lowerdir $lowerdir2 $upperdir $workdir $workdir
>> +
>> +# Test orphan whiteout in lower and upper layer, should remove
>> +echo "+ Orphan whiteout"
>> +mknod $lowerdir/foo c 0 0
>> +mknod $upperdir/foo c 0 0
>> +mknod $upperdir/bar c 0 0
>> +_overlay_fsck_dirs -a $lowerdir $upperdir $workdir >> $seqres.full 2>&1 || \
> 
> Don'y you mean -p ?  ;-p
> 
Will change to use -p and elsewhere, it's easier to understand.

Thanks,
Yi.

>> +       _fail "fsck should not fail"
>> +ls $lowerdir
>> +ls $upperdir
>> +rm -rf $lowerdir/* $upperdir/*
>> +
>> +# Test valid whiteout covering lower target, should not remove
>> +echo "+ Valid whiteout"
>> +touch $lowerdir2/foo $lowerdir2/bar
>> +mknod $upperdir/foo c 0 0
>> +mknod $lowerdir/bar c 0 0
>> +_overlay_fsck_dirs -a "$lowerdir:$lowerdir2" $upperdir $workdir >> \
>> +        $seqres.full 2>&1 || _fail "fsck should not fail"
>> +check_whiteout $upperdir/foo
>> +check_whiteout $lowerdir/bar
>> +
>> +# success, all done
>> +status=0
>> +exit
>> diff --git a/tests/overlay/201.out b/tests/overlay/201.out
>> new file mode 100644
>> index 0000000..20338db
>> --- /dev/null
>> +++ b/tests/overlay/201.out
>> @@ -0,0 +1,3 @@
>> +QA output created by 201
>> ++ Orphan whiteout
>> ++ Valid whiteout
>> diff --git a/tests/overlay/group b/tests/overlay/group
>> index 7e541e4..7c5fcbb 100644
>> --- a/tests/overlay/group
>> +++ b/tests/overlay/group
>> @@ -49,3 +49,4 @@
>>  044 auto quick copyup hardlink nonsamefs
>>  047 auto quick copyup hardlink
>>  048 auto quick copyup hardlink
>> +201 auto quick fsck
>> --
> 
> 
> Looks good
> 
> Amir.
> 
> .
> 


  reply	other threads:[~2017-12-15  5:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14  6:48 [PATCH for xfstests 0/4] overlay: add fsck.overlay basic tests zhangyi (F)
2017-12-14  6:48 ` [PATCH for xfstests 1/4] overlay: add filesystem check helper zhangyi (F)
2017-12-14  9:05   ` Amir Goldstein
2017-12-14 12:40     ` zhangyi (F)
2017-12-14 13:14       ` Amir Goldstein
2017-12-14  6:48 ` [PATCH for xfstests 2/4] overlay: add fsck.overlay whiteout test zhangyi (F)
2017-12-14 13:13   ` Amir Goldstein
2017-12-15  5:35     ` zhangyi (F) [this message]
2017-12-14  6:48 ` [PATCH for xfstests 3/4] overlay: add fsck.overlay opaque directory test zhangyi (F)
2017-12-14 13:25   ` Amir Goldstein
2017-12-14  6:48 ` [PATCH for xfstests 4/4] overlay: add fsck.overlay redirect " zhangyi (F)
2017-12-14 13:44   ` Amir Goldstein
2017-12-15  6:42     ` zhangyi (F)
2017-12-15  7:23       ` Amir Goldstein
2017-12-15  8:57         ` zhangyi (F)

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=380c648b-06b7-7afa-ef16-42e2d2d7ea7f@huawei.com \
    --to=yi.zhang@huawei.com \
    --cc=amir73il@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=miklos@szeredi.hu \
    /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