From: Anand Jain <anand.jain@oracle.com>
To: David Sterba <dsterba@suse.com>, fstests@vger.kernel.org
Cc: Josef Bacik <josef@toxicpanda.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/8] btrfs/012: adjust how we populate the fs to convert
Date: Thu, 7 Mar 2024 13:34:53 +0530 [thread overview]
Message-ID: <e31765bc-e151-4e0f-8d12-e5ccbc6d7d35@oracle.com> (raw)
In-Reply-To: <0b465808ecd272a04d5ea16383043b91afb6c2b0.1709664047.git.dsterba@suse.com>
On 3/6/24 00:22, David Sterba wrote:
> From: Josef Bacik <josef@toxicpanda.com>
>
> /lib/modules/$(uname -r)/ can have symlinks to the source tree where the
> kernel was built from, which can have all sorts of stuff, which will
> make the runtime for this test exceedingly long. We're just trying to
> copy some data into our tree to test with, we don't need the entire
> devel tree of whatever we're doing. Additionally VM's that aren't built
> with modules will fail this test.
>
> Update the test to use /etc, which will always exist. Additionally use
> timeout just in case there's large files or some other shenanigans so
> the test doesn't run forever copying large amounts of files.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
> tests/btrfs/012 | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/tests/btrfs/012 b/tests/btrfs/012
> index d9faf81ce1ad8e..7bc0c3ce59d28f 100755
> --- a/tests/btrfs/012
> +++ b/tests/btrfs/012
> @@ -33,6 +33,8 @@ _require_non_zoned_device "${SCRATCH_DEV}"
> _require_loop
> _require_extra_fs ext4
>
> +SOURCE_DIR=/etc
> +BASENAME=$(basename $SOURCE_DIR)
> BLOCK_SIZE=`_get_block_size $TEST_DIR`
>
> # Create & populate an ext4 filesystem
> @@ -41,9 +43,9 @@ $MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
> # Manual mount so we don't use -t btrfs or selinux context
> mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT
>
> -_require_fs_space $SCRATCH_MNT $(du -s /lib/modules/`uname -r` | ${AWK_PROG} '{print $1}')
> +_require_fs_space $SCRATCH_MNT $(du -s $SOURCE_DIR | ${AWK_PROG} '{print $1}')
>
> -cp -aR /lib/modules/`uname -r`/ $SCRATCH_MNT
> +timeout 10 cp -aRP $SOURCE_DIR $SCRATCH_MNT
TIMEOUT_PROG
> _scratch_unmount
>
> # Convert it to btrfs, mount it, verify the data
> @@ -51,7 +53,7 @@ $BTRFS_CONVERT_PROG $SCRATCH_DEV >> $seqres.full 2>&1 || \
> _fail "btrfs-convert failed"
> _try_scratch_mount || _fail "Could not mount new btrfs fs"
> # (Ignore the symlinks which may be broken/nonexistent)
> -diff -r /lib/modules/`uname -r`/ $SCRATCH_MNT/`uname -r`/ 2>&1 | grep -vw "source\|build"
> +diff --no-dereference -r $SOURCE_DIR $SCRATCH_MNT/$BASENAME/ 2>&1
>
> # Old ext4 image file should exist & be consistent
> $E2FSCK_PROG -fn $SCRATCH_MNT/ext2_saved/image >> $seqres.full 2>&1 || \
> @@ -62,12 +64,12 @@ mkdir -p $SCRATCH_MNT/mnt
> mount -o loop $SCRATCH_MNT/ext2_saved/image $SCRATCH_MNT/mnt || \
> _fail "could not loop mount saved ext4 image"
> # Ignore the symlinks which may be broken/nonexistent
> -diff -r /lib/modules/`uname -r`/ $SCRATCH_MNT/mnt/`uname -r`/ 2>&1 | grep -vw "source\|build"
> +diff --no-dereference -r $SOURCE_DIR $SCRATCH_MNT/mnt/$BASENAME/ 2>&1
> umount $SCRATCH_MNT/mnt
>
> # Now put some fresh data on the btrfs fs
> mkdir -p $SCRATCH_MNT/new
> -cp -aR /lib/modules/`uname -r`/ $SCRATCH_MNT/new
> +timeout 10 cp -aRP $SOURCE_DIR $SCRATCH_MNT/new
>
TIMEOUT_PROG
looks good.
Added for the pr.
> _scratch_unmount
>
> @@ -82,7 +84,7 @@ $E2FSCK_PROG -fn $SCRATCH_DEV >> $seqres.full 2>&1 || \
> # Mount the un-converted ext4 device & check the contents
> mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT
> # (Ignore the symlinks which may be broken/nonexistent)
> -diff -r /lib/modules/`uname -r`/ $SCRATCH_MNT/`uname -r`/ 2>&1 | grep -vw "source\|build"
> +diff --no-dereference -r $SOURCE_DIR $SCRATCH_MNT/$BASENAME/ 2>&1
>
> _scratch_unmount
>
next prev parent reply other threads:[~2024-03-07 8:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 18:51 [PATCH 0/8] Btrfs fstests fixups David Sterba
2024-03-05 18:52 ` [PATCH 1/8] btrfs/011: increase the runtime for replace cancel David Sterba
2024-03-05 18:52 ` [PATCH 2/8] btrfs/012: adjust how we populate the fs to convert David Sterba
2024-03-07 8:04 ` Anand Jain [this message]
2024-03-05 18:52 ` [PATCH 3/8] btrfs/131: don't run with subpage blocksizes David Sterba
2024-03-05 18:52 ` [PATCH 4/8] btrfs/213: make the test more reliable David Sterba
2024-03-05 18:52 ` [PATCH 5/8] btrfs/271: adjust failure condition David Sterba
2024-03-05 18:52 ` [PATCH 6/8] btrfs/287,btrfs/293: filter all btrfs subvolume delete calls David Sterba
2024-03-05 18:52 ` [PATCH 7/8] btrfs/291: remove image file after teardown David Sterba
2024-03-05 18:52 ` [PATCH 8/8] btrfs/400: test normal qgroup operations in a compress friendly way David Sterba
2024-03-07 12:28 ` [PATCH 0/8] Btrfs fstests fixups Anand Jain
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=e31765bc-e151-4e0f-8d12-e5ccbc6d7d35@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.com \
--cc=fstests@vger.kernel.org \
--cc=josef@toxicpanda.com \
--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