All of lore.kernel.org
 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 1/3] btrfs-progs: tests: also check subpage warning for type 2 test cases
Date: Wed, 18 Aug 2021 20:12:01 +0200	[thread overview]
Message-ID: <20210818181200.GW5047@twin.jikos.cz> (raw)
In-Reply-To: <20210818064420.866803-2-wqu@suse.com>

On Wed, Aug 18, 2021 at 02:44:18PM +0800, Qu Wenruo wrote:
> There are two types of test cases:
> 
> - Type 1 (without test.sh)
> - Type 2 (test.sh, mostly will override check_image())
> 
> For Type 2 tests, we check subpage related warnings of btrfs-check, but
> didn't check it for Type 1 test cases.
> 
> In fact, Type 1 test cases are more important, as they involve repair,
> which can generate new tree blocks, and we want to make sure such new
> tree blocks won't cause subpage related warnings.
> 
> This patch will add the extra check for Type 1 test cases.
> 
> And it will make sure the subpage related warnings are really from this
> test case, to prevent false alerts.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  tests/common | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/common b/tests/common
> index 805a447c84ce..a6f75c7ce237 100644
> --- a/tests/common
> +++ b/tests/common
> @@ -423,13 +423,23 @@ check_image()
>  {
>  	local image
>  
> +	tmp_output=$(mktemp --tmpdir btrfs-progs-test-check-image.XXXXXX)
> +
>  	image=$1
>  	echo "testing image $(basename $image)" >> "$RESULTS"
> -	"$TOP/btrfs" check "$image" >> "$RESULTS" 2>&1
> +	"$TOP/btrfs" check "$image" &> "$tmp_output"

So this captures the output but does not store it into the results file

>  	[ $? -eq 0 ] && _fail "btrfs check should have detected corruption"

and when this fails, we lack that information.
>  

> +	cat "$tmp_output" >> "$RESULTS"

So this should probably go before the 'check' call.

> +	# Also make sure no subpage related warnings
> +	check_test_results "$tmp_output" "$testname"
> +
>  	run_check "$TOP/btrfs" check --repair --force "$image"
> -	run_check "$TOP/btrfs" check "$image"
> +	run_check_stdout "$TOP/btrfs" check "$image" &> "$tmp_output"
> +
> +	# Also make sure no subpage related warnings for the repaired image
> +	check_test_results "$tmp_output" "$testname"
> +	rm -f "$tmp_output"
>  }
>  
>  # Extract a usable image from packed formats
> -- 
> 2.32.0

  reply	other threads:[~2021-08-18 18:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  6:44 [PATCH 0/3] btrfs-progs: make subpage warnings more strict Qu Wenruo
2021-08-18  6:44 ` [PATCH 1/3] btrfs-progs: tests: also check subpage warning for type 2 test cases Qu Wenruo
2021-08-18 18:12   ` David Sterba [this message]
2021-08-20 12:42   ` David Sterba
2021-08-18  6:44 ` [PATCH 2/3] btrfs-progs: tests: don't check subpage related warnings for fsck type 1 tests Qu Wenruo
2021-08-18  6:44 ` [PATCH 3/3] btrfs-progs: require full nodesize alignement for subpage support Qu Wenruo
2021-08-20 12:46 ` [PATCH 0/3] btrfs-progs: make subpage warnings more strict 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=20210818181200.GW5047@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.