linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@gmail.com>
To: Omar Sandoval <osandov@osandov.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>, kernel-team@fb.com
Subject: Re: [PATCH v2 4/4] btrfs-progs: tests: add test for receiving clone from duplicate subvolume
Date: Tue, 23 Jul 2019 12:21:29 +0100	[thread overview]
Message-ID: <CAL3q7H4MRkUfZaaCg1hOnGsPyCdD18ndg0knqG=oaUeGVTEpug@mail.gmail.com> (raw)
In-Reply-To: <45fa864ecb8805596dd7a1052f9e68509e79447b.1563822638.git.osandov@fb.com>

On Tue, Jul 23, 2019 at 3:25 AM Omar Sandoval <osandov@osandov.com> wrote:
>
> From: Omar Sandoval <osandov@fb.com>
>
> This test case is the reproducer for the previous fix.
>
> Signed-off-by: Omar Sandoval <osandov@fb.com>

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Looks good, thanks!

> ---
>  .../test.sh                                   | 34 +++++++++++++++++++
>  1 file changed, 34 insertions(+)
>  create mode 100755 tests/misc-tests/038-receive-clone-from-current-subvolume/test.sh
>
> diff --git a/tests/misc-tests/038-receive-clone-from-current-subvolume/test.sh b/tests/misc-tests/038-receive-clone-from-current-subvolume/test.sh
> new file mode 100755
> index 00000000..be648605
> --- /dev/null
> +++ b/tests/misc-tests/038-receive-clone-from-current-subvolume/test.sh
> @@ -0,0 +1,34 @@
> +#!/bin/bash
> +# Test that when receiving a subvolume whose received UUID already exists in
> +# the filesystem, we clone from the correct source (the subvolume that we are
> +# receiving, not the existing subvolume). This is a regression test for
> +# "btrfs-progs: receive: don't lookup clone root for received subvolume".
> +
> +source "$TEST_TOP/common"
> +
> +check_prereq btrfs
> +check_prereq mkfs.btrfs
> +
> +setup_root_helper
> +
> +rm -f disk
> +run_check truncate -s 1G disk
> +chmod a+w disk
> +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f disk
> +run_check $SUDO_HELPER mount -o loop disk "$TEST_MNT"
> +
> +run_check $SUDO_HELPER "$TOP/btrfs" subvolume create "$TEST_MNT/subvol"
> +run_check $SUDO_HELPER dd if=/dev/urandom of="$TEST_MNT/subvol/foo" \
> +       bs=1M count=1 status=none
> +run_check $SUDO_HELPER cp --reflink "$TEST_MNT/subvol/foo" "$TEST_MNT/subvol/bar"
> +run_check $SUDO_HELPER mkdir "$TEST_MNT/subvol/dir"
> +run_check $SUDO_HELPER mv "$TEST_MNT/subvol/foo" "$TEST_MNT/subvol/dir"
> +run_check $SUDO_HELPER "$TOP/btrfs" property set "$TEST_MNT/subvol" ro true
> +run_check $SUDO_HELPER "$TOP/btrfs" send -f send.data "$TEST_MNT/subvol"
> +
> +run_check $SUDO_HELPER mkdir "$TEST_MNT/first" "$TEST_MNT/second"
> +run_check $SUDO_HELPER "$TOP/btrfs" receive -f send.data "$TEST_MNT/first"
> +run_check $SUDO_HELPER "$TOP/btrfs" receive -f send.data "$TEST_MNT/second"
> +
> +run_check $SUDO_HELPER umount "$TEST_MNT"
> +rm -f disk send.data
> --
> 2.22.0
>


-- 
Filipe David Manana,

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

  reply	other threads:[~2019-07-23 11:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 19:15 [PATCH v2 0/4] btrfs-progs: fix clone from wrong subvolume Omar Sandoval
2019-07-22 19:15 ` [PATCH v2 1/4] btrfs-progs: receive: remove commented out transid checks Omar Sandoval
2019-07-24 11:22   ` David Sterba
2019-07-24 12:10     ` Filipe Manana
2019-07-22 19:15 ` [PATCH v2 2/4] btrfs-progs: receive: get rid of unnecessary strdup() Omar Sandoval
2019-07-22 19:15 ` [PATCH v2 3/4] btrfs-progs: receive: don't lookup clone root for received subvolume Omar Sandoval
2019-07-23 11:19   ` Filipe Manana
2020-02-24 14:53     ` Filipe Manana
2020-03-11  8:03       ` Omar Sandoval
2019-07-22 19:15 ` [PATCH v2 4/4] btrfs-progs: tests: add test for receiving clone from duplicate subvolume Omar Sandoval
2019-07-23 11:21   ` Filipe Manana [this message]
2019-09-04 20:35 ` [PATCH v2 0/4] btrfs-progs: fix clone from wrong subvolume Omar Sandoval
2019-10-10  7:06   ` Qu Wenruo

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='CAL3q7H4MRkUfZaaCg1hOnGsPyCdD18ndg0knqG=oaUeGVTEpug@mail.gmail.com' \
    --to=fdmanana@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=osandov@osandov.com \
    /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).