From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 8F73C8017D for ; Mon, 26 Oct 2026 12:43:22 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69QCg6hY010787; Mon, 26 Oct 2026 15:42:07 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69QCg6hY010787 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="X5FhgAJl" Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69QCfi46010737 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 26 Oct 2026 15:41:44 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69QCfi46010737 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-48dfaaea30cso2112934f8f.0 for ; Mon, 26 Oct 2026 05:41:44 -0700 (PDT) X-Gm-Message-State: AFq9FYJ0N0/XUpkBK4WOGOcNtxyIf0HVO1spaONT8D/OzEQ2Cmnngls5 D1Z9f/roawoPRK7yoiqAFmvdoEALbHpoy4xSA0iGZ0WqpdZlcOoysSOvA6kTAJ1WHTKcfv37qyd iuk6rDakW9JA6wDyLwk9Xghdmf4mdJ+b7fWV94fEae/bzX4d179fNxQ== X-Gm-Gg: AYBFou3zEwiNHX7IrX/3ph4fUf+5/G7/1gZZG3F/61XySgaNFvIUajWRR6RKQ7bXtkK dJIwjIXxoF2pBHo6NL9qhh0C2cyvLGm86eK8JTbT24jywcCgCk7DZqGDcVrgxGIe1KcLQO7A91G yqBQaUDcwIOnTyllbjEtUZBiK7daNO6CeUn7VDR5Rh1FrIAQuWBMgPTImrZN2WA/eqzZxR+XGBU fQSSFtTG3EdvHRg5eRszyUGfhLKr1Gzsp0W3jqsimrJ+4yNMd24Ao5X9aLZCi95jc8m1l70TCSu N6S+kOVy3sbiuVh49095DWNX9biRwlcxnhZQLowv1sdVJ3TAlfO7+Jl5DqgeIIL2/zzngHfcaKt 8aRB/eUT0xh/ATQIRWvz+zzM0BA== X-Received: by 2002:a05:6000:2281:b0:48e:4f1e:5e24 with SMTP id ffacd0b85a97d-48e4f1e5e33mr5455350f8f.14.1793018504159; Mon, 26 Oct 2026 05:41:44 -0700 (PDT) X-Received: by 2002:a05:6000:2281:b0:48e:4f1e:5e24 with SMTP id ffacd0b85a97d-48e4f1e5e33mr5455232f8f.14.1793018503213; Mon, 26 Oct 2026 05:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793018503; cv=none; d=google.com; s=arc-20260327; b=IG8qytJ8mJCFdPV89L8FZa+LI4dn+/JD+l+nv0wbVbEafY1xViWMwLlZE9OieQCszi QBbTpPcD4Ju9qA595duhPkLiHG/UYCeyv5AfZCpHjz0DVTnANMj4373xxSASEc9V8fTa GZ5MUG9qqWzGr8SVuPqFIZD5hGcbGDdNaSwvE0fotKpaK8uu8xvIqFhyKa5wrWrhzUyw hUNhSlmtqP3sZ1P32gJpoB7kQT0B3H5qXGqAjPwRT6O1uK/9ZP7zxS5dxeGCZPKSF1+Z k2vohzi0kyC1J5XIH1wzqYwc/eldJTO4N42wFwhUx73+jHawAUrGclvbJjt37Lny6Kco HhNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=MCX4Cbroh3apme7Kt6gcq0ZYcnS6v/L+Zdm7QBpalhM=; fh=WpT6aB7RBAGHZeWZzqAr71yzRFbPTYkPWKsRagLn48Q=; b=RPVmAjm0FoLyympbWQ0IDjiGMfsMLRvfv93lj1oflqESjs3G3SXD8OTVWO3E4lXtz3 fA/EQLA1GpLqgVUlJ7K1akw5yoI+i18GnUZB6S5K0S7ae2rB/3+WEXOgDnWFrOBM+/SL uUaYhEkBUfFmHuZhPEWfXAkodUp3C/71Q+dqDQJ0ioWBGEMSsKKpCqY60bUN5lDQ/W1M EAUMDpohZEXajMXnRknTNrVzmKyKdeCCnlecdYQHP7c11IINAACDdpLcxguZBxHlEz8y hx5Smv1n8nIMPsQcm6+quNXsmhpF/h/Q7QJr2JED+dInFHSulAZriCEdL8xvJ6AUIgQF EJsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=X5FhgAJl; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48e3eb9c63csi13620724f8f.20.2026.10.26.05.41.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2026 05:41:43 -0700 (PDT) Received-SPF: pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=X5FhgAJl; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=MCX4Cbroh3apme7Kt6gcq0ZYcnS6v/L+Zdm7QBpalhM=; b=X5FhgAJlIKSc 8Cij7VOvFwNdeOxM9iMBu2w3GKamOSGxMqk6YUuPlZlrGRuvvdGNbeYHI0efetfgqkEF/wuAL4bxe GYY6LDU9wFeZdeVF5O3r63XcTFwIPcfQjKBKQKI9TfObGrC8cKxMul1/5aFdwab82P195gZ48x6Ev a/8mZrKHCIMOS6hyYiB5K4Rhs/WHb4CnUWpjAY0/jkvSpq+ZsfxIh1QGd5RSklwP8JnGWak6Vjrzl P3Hiw6TXPlqBVxeEOYUbK5uiMa3e5Wx3Q0smNlAuGtAMwnDhJ6r02dJ+7C/q+5nlXgV9nYeRXJvj+ HHEFtxYHutiF2ivmpBvmyw==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=LekKit-T14) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xLJxX-002Tnz-2C; Mon, 26 Oct 2026 13:41:34 +0100 From: Eva Kurchatova To: khorenko@virtuozzo.com Date: Mon, 26 Oct 2026 14:40:13 +0200 Message-ID: <20261026124139.606106-5-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261026124139.606106-1-eva.kurchatova@virtuozzo.com> References: <20261026124139.606106-1-eva.kurchatova@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 4/6] selftests/zram: fail when a step fails X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org The library prints FAIL for a step that fails and carries on, zram01 and zram02 print their verdict and exit 0 either way, and zram.sh exits with the status of zram02 alone, so no zram failure reached the runner. A failed step now fails its test, a failed test fails the suite. https://virtuozzo.atlassian.net/browse/VSTOR-134205 Feature: fix selftests Signed-off-by: Eva Kurchatova --- tools/testing/selftests/zram/zram.sh | 11 +++++++++-- tools/testing/selftests/zram/zram01.sh | 4 ++++ tools/testing/selftests/zram/zram02.sh | 1 + tools/testing/selftests/zram/zram_lib.sh | 24 +++++++++++++++--------- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/zram/zram.sh b/tools/testing/selftests/zram/zram.sh index b0b91d9b0dc2..56adeb17768f 100755 --- a/tools/testing/selftests/zram/zram.sh +++ b/tools/testing/selftests/zram/zram.sh @@ -4,15 +4,22 @@ TCID="zram.sh" . ./zram_lib.sh +# A failure outranks a skip, a skip outranks a pass +result () { + [ $1 -eq $ksft_skip ] && [ $ret -ne 0 ] || ret=$1 +} + run_zram () { echo "--------------------" echo "running zram tests" echo "--------------------" -./zram01.sh +./zram01.sh || result $? echo "" -./zram02.sh +./zram02.sh || result $? } check_prereqs +ret=0 run_zram +exit $ret diff --git a/tools/testing/selftests/zram/zram01.sh b/tools/testing/selftests/zram/zram01.sh index 8f4affe34f3e..8ab63c98c1af 100755 --- a/tools/testing/selftests/zram/zram01.sh +++ b/tools/testing/selftests/zram/zram01.sh @@ -33,6 +33,9 @@ zram_algs="lzo" zram_fill_fs() { + # An earlier step failed, and after a failed mount the directory + # would be filled on the host's filesystem + [ $ERR_CODE -ne 0 ] && return for i in $(seq $dev_start $dev_end); do echo "fill zram$i..." local b=0 @@ -70,6 +73,7 @@ zram_cleanup if [ $ERR_CODE -ne 0 ]; then echo "$TCID : [FAIL]" + exit 1 else echo "$TCID : [PASS]" fi diff --git a/tools/testing/selftests/zram/zram02.sh b/tools/testing/selftests/zram/zram02.sh index 2418b0c4ed13..54e17bbfdbb7 100755 --- a/tools/testing/selftests/zram/zram02.sh +++ b/tools/testing/selftests/zram/zram02.sh @@ -39,6 +39,7 @@ zram_cleanup if [ $ERR_CODE -ne 0 ]; then echo "$TCID : [FAIL]" + exit 1 else echo "$TCID : [PASS]" fi diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh index 21ec1966de76..25e32cb956df 100755 --- 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 i=$(($i + 1)) echo "$sys_path = '$max_streams'" @@ -156,7 +158,7 @@ zram_compress_alg() for alg in $zram_algs; do local sys_path="/sys/block/zram${i}/comp_algorithm" echo "$alg" > $sys_path || \ - echo "FAIL can't set '$alg' to $sys_path" + { echo "FAIL can't set '$alg' to $sys_path"; ERR_CODE=-1; } i=$(($i + 1)) echo "$sys_path = '$alg'" done @@ -171,7 +173,7 @@ zram_set_disksizes() for ds in $zram_sizes; do local sys_path="/sys/block/zram${i}/disksize" echo "$ds" > $sys_path || \ - echo "FAIL can't set '$ds' to $sys_path" + { echo "FAIL can't set '$ds' to $sys_path"; ERR_CODE=-1; } i=$(($i + 1)) echo "$sys_path = '$ds'" @@ -188,7 +190,7 @@ zram_set_memlimit() for ds in $zram_mem_limits; do local sys_path="/sys/block/zram${i}/mem_limit" echo "$ds" > $sys_path || \ - echo "FAIL can't set '$ds' to $sys_path" + { echo "FAIL can't set '$ds' to $sys_path"; ERR_CODE=-1; } i=$(($i + 1)) echo "$sys_path = '$ds'" @@ -205,13 +207,15 @@ zram_makeswap() mkswap /dev/zram$i > err.log 2>&1 if [ $? -ne 0 ]; then cat err.log - echo "FAIL mkswap /dev/zram$1 failed" + echo "FAIL mkswap /dev/zram$i failed" + ERR_CODE=-1 fi swapon /dev/zram$i > err.log 2>&1 if [ $? -ne 0 ]; then cat err.log - echo "FAIL swapon /dev/zram$1 failed" + echo "FAIL swapon /dev/zram$i failed" + ERR_CODE=-1 fi echo "done with /dev/zram$i" @@ -229,6 +233,7 @@ zram_swapoff() if [ $? -ne 0 ]; then cat err.log echo "FAIL swapoff /dev/zram$i failed" + ERR_CODE=-1 fi done dev_makeswap=-1 @@ -248,6 +253,7 @@ zram_makefs() if [ $? -ne 0 ]; then cat err.log echo "FAIL failed to make $fs on /dev/zram$i" + ERR_CODE=-1 fi i=$(($i + 1)) echo "zram mkfs.$fs: OK" @@ -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 -- 2.56.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel