All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>, khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 4/6] selftests/zram: fail when a step fails
Date: Mon, 26 Oct 2026 12:46:00 +0000	[thread overview]
Message-ID: <010701a1783f0ca5-c0e78f06-c648-4586-9155-c41198908201-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261026124139.606106-5-eva.kurchatova@virtuozzo.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/zram: zram_load() and zram_cleanup() failures still yield PASS
--

commit 0339f0cb6294df6e9df86072b01edefd848cf680
Author: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

selftests/zram: fail when a step fails

This patch makes the zram selftest library set ERR_CODE when a step fails.
It makes zram01 and zram02 exit 1 on failure, and makes zram.sh exit with
the combined result of both tests.

Link: https://virtuozzo.atlassian.net/browse/VSTOR-134205

> diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh
> --- a/tools/testing/selftests/zram/zram_lib.sh
> +++ b/tools/testing/selftests/zram/zram_lib.sh

[ ... ]

> @@ -131,12 +131,14 @@ zram_max_streams()
>  	for max_s in $zram_max_streams; do
>  		local sys_path="/sys/block/zram${i}/max_comp_streams"
>  		echo $max_s > $sys_path || \
> -			echo "FAIL failed to set '$max_s' to $sys_path"
> +			{ echo "FAIL failed to set '$max_s' to $sys_path"; ERR_CODE=-1; }
>  		sleep 1
>  		local max_streams=$(cat $sys_path)
>  
> -		[ "$max_s" -ne "$max_streams" ] && \
> -			echo "FAIL can't set max_streams '$max_s', get $max_stream"
> +		if [ "$max_s" -ne "$max_streams" ]; then
> +			echo "FAIL can't set max_streams '$max_s', get $max_streams"
> +			ERR_CODE=-1
> +		fi

[Severity: Low]
This isn't a regression in the new code, but is the max_streams check
complete?

If cat returns an empty or non-numeric value, the test
[ "$max_s" -ne "$max_streams" ] fails with a shell error (status 2).  The
if statement treats that as false, so the FAIL branch is skipped and
ERR_CODE stays unset in zram_max_streams().

This is caught only if the preceding echo to max_comp_streams also failed.

[ ... ]

> @@ -261,7 +267,7 @@ zram_mount()
>  		echo "mount /dev/zram$i"
>  		mkdir zram$i
>  		mount /dev/zram$i zram$i > /dev/null || \
> -			echo "FAIL mount /dev/zram$i failed"
> +			{ echo "FAIL mount /dev/zram$i failed"; ERR_CODE=-1; }
>  		dev_mounted=$i
>  	done

[Severity: Low]
The commit message says "A failed step now fails its test", but some library
steps still do not record failures in ERR_CODE.  Can a zram test still print
PASS and exit 0 after a library step failed?

In zram_load(), the result of these commands is not checked:

    cat /sys/class/zram-control/hot_add > /dev/null
    ...
    modprobe zram num_devices=$dev_num

A failure there is caught only indirectly, if a later sysfs write fails.

In zram_cleanup(), the result of these commands is not checked:

    swapoff /dev/zram$i
    ...
    umount /dev/zram$i
    ...
    echo 1 > /sys/block/zram${i}/reset

zram_cleanup() runs before the verdict in zram01 and zram02.  A teardown
failure that leaves swap or a mount behind therefore still ends in PASS.

Should these steps set ERR_CODE=-1 on failure as well, or should the commit
message say that load and cleanup are excluded?

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261026124139.606106-1-eva.kurchatova@virtuozzo.com?part=4

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-10-26 12:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 12:40 [Devel] [PATCH hci-8.1 0/6] selftests: fix sticky failure in runners Eva Kurchatova
2026-10-26 12:40 ` [Devel] [PATCH hci-8.1 1/6] ms/selftests/bpf: Upon failures, exit with code 1 in test_xsk.sh Eva Kurchatova
2026-10-26 12:44   ` no-reply
2026-10-26 12:40 ` [Devel] [PATCH hci-8.1 2/6] selftests/memfd: fail run_hugetlbfs_test.sh when a test fails Eva Kurchatova
2026-10-26 12:44   ` no-reply
2026-10-26 12:40 ` [Devel] [PATCH hci-8.1 3/6] selftests: sigaltstack: report the failures the signal handler records Eva Kurchatova
2026-10-26 12:45   ` no-reply
2026-10-26 12:40 ` [Devel] [PATCH hci-8.1 4/6] selftests/zram: fail when a step fails Eva Kurchatova
2026-10-26 12:46   ` no-reply [this message]
2026-10-26 12:40 ` [Devel] [PATCH hci-8.1 5/6] selftests/futex: fail run.sh when a test fails Eva Kurchatova
2026-10-26 12:47   ` no-reply
2026-10-26 12:40 ` [Devel] [PATCH hci-8.1 6/6] selftests/futex: fail futex_waitv when the waiter failed Eva Kurchatova
2026-10-26 12:47   ` no-reply

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=010701a1783f0ca5-c0e78f06-c648-4586-9155-c41198908201-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=eva.kurchatova@virtuozzo.com \
    --cc=khorenko@virtuozzo.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.