[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@xxxxxxxx> --- check | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check b/check index d2e5129620bd..487da43537ad 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 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 -- 2.38.1