linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 2/2] btrfs-progs: tests: check the result log for critical warnings
Date: Mon,  9 Nov 2020 13:39:52 +0800	[thread overview]
Message-ID: <20201109053952.490678-3-wqu@suse.com> (raw)
In-Reply-To: <20201109053952.490678-1-wqu@suse.com>

Introduce a new function, check_test_results(), for
misc/fsck/convert/mkfs test cases.

This function is currently to catch warning message for subpage support,
but can be later expanded for other usages.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/common           | 12 ++++++++++++
 tests/convert-tests.sh |  1 +
 tests/fsck-tests.sh    |  1 +
 tests/misc-tests.sh    |  1 +
 tests/mkfs-tests.sh    |  1 +
 5 files changed, 16 insertions(+)

diff --git a/tests/common b/tests/common
index b3f5cc139525..f1314d8f5a20 100644
--- a/tests/common
+++ b/tests/common
@@ -817,4 +817,16 @@ init_env()
 		echo "  convert: $TEST_ARGS_CONVERT" >> "$RESULTS"
 	fi
 }
+
+# Catch critical warning messages
+check_test_results()
+{
+	local results="$1"
+	local testname="$2"
+
+	# Check subpage related warning
+	if grep -q "crrosses 64K page boundary" "$results"; then
+		_fail "found subpage related warning for case $testname"
+	fi
+}
 init_env
diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh
index 24b3ec0df144..9653033fe09a 100755
--- a/tests/convert-tests.sh
+++ b/tests/convert-tests.sh
@@ -70,6 +70,7 @@ run_one_test() {
 			fi
 			_fail "test failed for case $testname"
 		fi
+		check_test_results "$RESULTS" "$testname"
 	else
 		_fail "custom test script not found"
 	fi
diff --git a/tests/fsck-tests.sh b/tests/fsck-tests.sh
index 15e3d8d5995c..ed18136f3ab9 100755
--- a/tests/fsck-tests.sh
+++ b/tests/fsck-tests.sh
@@ -64,6 +64,7 @@ run_one_test() {
 			fi
 			_fail "test failed for case $(basename $testname)"
 		fi
+		check_test_results "$RESULTS" "$testname"
 	else
 		# Type 1
 		check_all_images
diff --git a/tests/misc-tests.sh b/tests/misc-tests.sh
index 3b49ab012e78..7da13513641a 100755
--- a/tests/misc-tests.sh
+++ b/tests/misc-tests.sh
@@ -66,6 +66,7 @@ do
 			fi
 			_fail "test failed for case $(basename $i)"
 		fi
+		check_test_results "$RESULTS" "$(basename $i)"
 	fi
 	cd "$TEST_TOP"
 done
diff --git a/tests/mkfs-tests.sh b/tests/mkfs-tests.sh
index 150f094f2303..d6e8bb6702c9 100755
--- a/tests/mkfs-tests.sh
+++ b/tests/mkfs-tests.sh
@@ -61,6 +61,7 @@ do
 			fi
 			_fail "test failed for case $(basename $i)"
 		fi
+		check_test_results "$RESULTS" "$(basename $i)"
 	fi
 	cd "$TEST_TOP"
 done
-- 
2.29.2


  parent reply	other threads:[~2020-11-09  5:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09  5:39 [PATCH 0/2] btrfs-progs: add new precaution check for incoming subpage support Qu Wenruo
2020-11-09  5:39 ` [PATCH 1/2] btrfs-progs: check: detect and warn about tree blocks cross 64K page boundary Qu Wenruo
2021-03-02  8:48   ` Wang Yugui
2021-03-02 10:14     ` Qu Wenruo
2021-03-02 10:36       ` Wang Yugui
2021-03-06  0:33         ` Qu Wenruo
2020-11-09  5:39 ` Qu Wenruo [this message]
2021-02-19 14:12   ` [PATCH 2/2] btrfs-progs: tests: check the result log for critical warnings 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=20201109053952.490678-3-wqu@suse.com \
    --to=wqu@suse.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;
as well as URLs for NNTP newsgroup(s).