summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2022-12-14 08:08:31 +0800
committerZorro Lang <zlang@kernel.org>2022-12-14 22:51:19 +0800
commit8a1c35e615fdf34021452f84c8a67ca8b2673256 (patch)
tree868f839df2a53bc1c16a9cb9edc9e1a7c0baef94 /check
parent8fc059413cc1a9e4efa56e7a627ff9166c2842a4 (diff)
check: call _check_dmesg even if the test case failed
[BUG] When KEEP_DMESG=yes is specified, passed test cases will also keep their $seqres.dmesg files. However for failed test cases (caused by _fail calls), their dmesg files are not saved at all: # rm -rf results/btrfs/219* # ./check btrfs/219 # ls result/btrfs/219* results/btrfs/219.full results/btrfs/219.out.bad [CAUSE] $seqres.dmesg is created (and later deleted depending on config) by _check_dmesg() function. But if a test case failed by calling _fail, then we no longer call _check_dmesg(), thus no dmesg will be saved no matter whatever the config is. [FIX] If the test case itself failed, then still call _check_dmesg() to either save the dmesg unconditionally (KEEP_DMESG=yes case), or save the dmesg if there is something wrong (default). The dmesg can be pretty handy debug clue for both cases. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Disseldorp <ddiss@suse.de> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'check')
-rwxr-xr-xcheck3
1 files changed, 3 insertions, 0 deletions
diff --git a/check b/check
index d2e51296..f7f93dc4 100755
--- a/check
+++ b/check
@@ -950,6 +950,9 @@ function run_section()
_scratch_unmount 2> /dev/null
rm -f ${RESULT_DIR}/require_test*
rm -f ${RESULT_DIR}/require_scratch*
+ # Even though we failed, there may be something interesting in
+ # dmesg which can help debugging.
+ _check_dmesg
tc_status="fail"
else
# The test apparently passed, so check for corruption