Re: [PATCH 3/3] t/zbd: check log file for failed assertions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020/07/27 12:16, Dmitry Fomichev wrote:
> Currently, a ZBD test can succeed even if an fio assertion is raised
> during its run. Search every ZBD test log file for failed assertions
> and fail the test if any were found.
> 
> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@xxxxxxx>
> ---
>  t/zbd/test-zbd-support | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support
> index 471a3487..139495d3 100755
> --- a/t/zbd/test-zbd-support
> +++ b/t/zbd/test-zbd-support
> @@ -77,6 +77,13 @@ check_reset_count() {
>      eval "[ '$reset_count' '$1' '$2' ]"
>  }
>  
> +# Check log for failed assertions and crashes. Without these checks,
> +# a test can succeed even when these events happen, but it must fail.
> +check_log() {
> +     [ ! -f "${logfile}.${1}" ] && return 0
> +     ! grep -q -e "Assertion " -e "Aborted " "${logfile}.${1}"
> +}
> +
>  # Whether or not $1 (/dev/...) is a SCSI device.
>  is_scsi_device() {
>      local d f
> @@ -1008,7 +1015,7 @@ trap 'intr=1' SIGINT
>  for test_number in "${tests[@]}"; do
>      rm -f "${logfile}.${test_number}"
>      echo -n "Running test $(printf "%02d" $test_number) ... "
> -    if eval "test$test_number"; then
> +    if eval "test$test_number" && check_log $test_number; then
>  	status="PASS"
>  	cc_status="${green}${status}${end}"
>  	((passed++))
> 

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxx>

-- 
Damien Le Moal
Western Digital Research




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux