Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 3/3] btrfs-progs: misc-tests: add test to ensure the restored image can be mounted
Date: Thu, 29 Apr 2021 21:56:31 +0200	[thread overview]
Message-ID: <20210429195631.GA7604@twin.jikos.cz> (raw)
In-Reply-To: <20210429090658.245238-4-wqu@suse.com>

On Thu, Apr 29, 2021 at 05:06:58PM +0800, Qu Wenruo wrote:
> This new test case is to make sure the restored image file has been
> properly enlarged so that newer kernel won't complain.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  .../048-image-restore-mount/test.sh           | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100755 tests/misc-tests/048-image-restore-mount/test.sh
> 
> diff --git a/tests/misc-tests/048-image-restore-mount/test.sh b/tests/misc-tests/048-image-restore-mount/test.sh
> new file mode 100755
> index 000000000000..b61b7a7188cf
> --- /dev/null
> +++ b/tests/misc-tests/048-image-restore-mount/test.sh
> @@ -0,0 +1,20 @@
> +#!/bin/bash
> +# Verify that the restored image of an empty btrfs filesystem can still be
> +# mounted
> +
> +source "$TEST_TOP/common"
> +
> +check_prereq btrfs-image
> +check_prereq mkfs.btrfs
> +check_prereq btrfs
> +
> +tmp=$(mktemp -d --tmpdir btrfs-progs-image.XXXXXXXX)
> +prepare_test_dev
> +
> +run_check_mkfs_test_dev
> +run_check "$TOP/btrfs-image" "$TEST_DEV" "$tmp/dump"
> +run_check "$TOP/btrfs-image" -r "$tmp/dump" "$tmp/restored"
> +
> +run_check $SUDO_HELPER mount -t btrfs -o loop "$tmp/restored" "$TEST_MNT"
> +umount "$TEST_MNT" &> /dev/null

Please note that unlike in fstests, the progs testsuite is intentionally
verbose and the command output should end up in the logs, and all main
commands should be started with run_check (in this case with
$SUDO_HELPER as well).

  reply	other threads:[~2021-04-29 20:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29  9:06 [PATCH v2 0/3] btrfs-progs: image: make restored image file to be properly enlarged Qu Wenruo
2021-04-29  9:06 ` [PATCH v2 1/3] btrfs-progs: image: remove the dead stat() call Qu Wenruo
2021-04-29  9:06 ` [PATCH v2 2/3] btrfs-progs: image: enlarge the output file if no tree modification is needed for restore Qu Wenruo
2021-04-29  9:06 ` [PATCH v2 3/3] btrfs-progs: misc-tests: add test to ensure the restored image can be mounted Qu Wenruo
2021-04-29 19:56   ` David Sterba [this message]
2021-04-29 19:54 ` [PATCH v2 0/3] btrfs-progs: image: make restored image file to be properly enlarged David Sterba

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=20210429195631.GA7604@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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