From patchwork Tue Jul 12 08:21:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 12914617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F181C43334 for ; Tue, 12 Jul 2022 08:22:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232512AbiGLIWS (ORCPT ); Tue, 12 Jul 2022 04:22:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232685AbiGLIVy (ORCPT ); Tue, 12 Jul 2022 04:21:54 -0400 Received: from esa14.fujitsucc.c3s2.iphmx.com (esa14.fujitsucc.c3s2.iphmx.com [68.232.156.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 678F2A2EE8 for ; Tue, 12 Jul 2022 01:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1657614081; x=1689150081; h=from:to:cc:subject:date:message-id:content-id: content-transfer-encoding:mime-version; bh=+51acWMFUSc+gpwwj9x45VemasILu+eajgYIkVHe9Ts=; b=t3BL1se6ihmIVbYmP5nnsKVvrh0WrToNW+yDZkjqAPiulP9oEmF3+4aF 9PSeK/9Zitk5hBod3PaNckUQsLG7sssvkrCdk5lTaihNI6PXwBf9Lkels U5VZINDAS0MJImJMytGSJ2++pul/Uy4BCtFE82hQYb87OvGxJk2kOpKEd FEEVCsXVah6ZOVLSV12dOOdfga/ZjtmsuFufNezAF48Y514Oj95utlWe4 ikWixbPxDkjKhmsdB4+2ncAD4RLTUbPb09kd+iIaGeA3OK8pKV7QAdZOS lZ49bQgaltkG5L7uTmnejyCiINCAWzEid6pLpRL8nQACCOAxc+yNzhbdp A==; X-IronPort-AV: E=McAfee;i="6400,9594,10405"; a="59965920" X-IronPort-AV: E=Sophos;i="5.92,265,1650898800"; d="scan'208";a="59965920" Received: from mail-tycjpn01lp2177.outbound.protection.outlook.com (HELO JPN01-TYC-obe.outbound.protection.outlook.com) ([104.47.23.177]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2022 17:21:17 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VkKfVprkklwO/DXqta/0QYidPtYN+H5T+TgqSYldadTsIUKNrgcq5ahmvzCy/JcYHaiMZnSwCkyBcFBXAKeQE9CoIA+fBgbpeP/ZcQmvZcSneyaRr/w/nqPLXp7IFZwDhwoyXOTqZ00HfbpwRJ8K1eVY4A0UL4x3nMMb2j3sz0iOf54M1vWhE/ikBHMB4PRo4q9UTeVYtJCBuZoOgHr0o/AtNFuE/Ws3CL+N9hooYkEhNbK9Ijr0VwlKJDIUs7YXPQXIGuru2TxS6RaBthVKvVlgxwzNkGb2mNsVGBUPFZAc/xub+z1B+MTvJsCHoUyJJrH5v7f0QafnoNuwXlnphQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+51acWMFUSc+gpwwj9x45VemasILu+eajgYIkVHe9Ts=; b=AVsS+xzMDXNjAnrKVgZLynaYH8+N/RJCrRzgmNpIMpukCXR6ozagnFSeDtdAhhM6QEi6GSq4I/OCoRBxwCVHfQU8/8dHaxBbvqnE/G5GLuhXu3GeXfURFRETDg81IMYgTl08c7CVtWa1oXcP+n3i4qksCvEAJGHD6cg3ujZDAeRTVkYgtNuv1kmfrDeoNdQ0omJek4GcJ6TtUPZkpVlkOOckwoi4VFJPuXMvXAEcfOACOAzJH+UzItU1+7JcwITj3axPvsVZbTsJyL0x1STlNpbVhDLJGTNOW7H5womwC+7TEEeW0dC8gbHxPwj3jpP9Y4O4q4uwC+ca4Oae65VBOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fujitsu.com; dmarc=pass action=none header.from=fujitsu.com; dkim=pass header.d=fujitsu.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.onmicrosoft.com; s=selector2-fujitsu-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+51acWMFUSc+gpwwj9x45VemasILu+eajgYIkVHe9Ts=; b=TbuzbdBcbxSCQu+H4DG2HdADmMbvcXOE7sZHRUmAi4bXRcgBZSMft7/suDocQW3qDnvOYFHLShcYcQHL/12oi0iiguVkQtlIF6iFXHDzAE3poQjqn1Ag9vVfuDr9TpOOkI0mKBXvOXCNFSAB52wG1A6PI6MZMNTRxirB3Xb/og8= Received: from TYCPR01MB9305.jpnprd01.prod.outlook.com (2603:1096:400:196::10) by TY2PR01MB3691.jpnprd01.prod.outlook.com (2603:1096:404:dc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Tue, 12 Jul 2022 08:21:11 +0000 Received: from TYCPR01MB9305.jpnprd01.prod.outlook.com ([fe80::8d7a:baa8:3b18:cd93]) by TYCPR01MB9305.jpnprd01.prod.outlook.com ([fe80::8d7a:baa8:3b18:cd93%8]) with mapi id 15.20.5417.026; Tue, 12 Jul 2022 08:21:11 +0000 From: "lizhijian@fujitsu.com" To: "linux-block@vger.kernel.org" , "shinichiro.kawasaki@wdc.com" CC: "bvanassche@acm.org" , "lizhijian@fujitsu.com" Subject: [PATCH blktests v2] common, tests: Support printing multiple skip reasons Thread-Topic: [PATCH blktests v2] common, tests: Support printing multiple skip reasons Thread-Index: AQHYlchYp+hJb/1IDEaA2XEJcTS1hQ== Date: Tue, 12 Jul 2022 08:21:11 +0000 Message-ID: <20220712082810.1868224-1-lizhijian@fujitsu.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.31.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=fujitsu.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b48a59b7-bff0-48e3-3f75-08da63df7ae3 x-ms-traffictypediagnostic: TY2PR01MB3691:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wBVvWCC3qQKFEt5ydYdnzc3TYGXkt+8kHy5h1R6ojBPm9ynP8/VQM5Zpb2nIwvd2OFeL6GF0ZqLzLjOan+N3OP+hwiwkWv19WG/jsZ6bDksECNfpY3zOAEi+5QQA/DJ+H37Q9jK5YcB/smIwhzvuYIUS1oDn0WPyyPRBD7tPoRpcSMVf02XvaNiLiA4ormf7FhagjugkCziELWM7OjvDvqRAvxWHVwwMa6eROKOMZDHaIxyBt6WBxIOdy4P3fdVFPYpelvndkQDF21qzUnuI7JnfujDP7k/uV7CHv7IGxSLl2y3NSX7DuUHbEjxip77obESjIP6XCAT/xKNVLT5MrJ1xs0qaU0Hwi/jPnJ54Eksa1Km8Z/LjECj5JT/gXHWoFTw7CWffIXqe1eKEc3Jo0wiB0N0JQdRCZuRMeqjo3+xH51LgeIVbBcsYgWL++5zuZRQleeb5WFf8JxvUU7wLRPVjRQuwpC60FX6xBFeQt2J8C1JfnsKJ6Da3pf11Hnxj6v5IOevklWIyaX4WUjIDGyq3lC1vl07/4m3figAm5WHUZJ2Dh9gdk0AFXdyfnSx1cPeU0wOaMv/fSzEFRzUpeyCSseFVB4kWEcENYlXw1dLyPSntZv/uOn6iSGFf4lxjJ3D6OjrHvpPng0D0N9E8/ARQKrlqSs8HafKzeh+85efAtIvOb8af3ixnaf0u9AHItj2+dVSKPYxT2lEFGCDPrzfRxJbYjH2RrLjwMiKPmYd86OGxzvUlPJMGGS0/zKTWG1WR90DZA4WT2OqakNn7t6pAzIuteWLmsULLQ0soE0+GJq0QOjdPxhJ3Y4x2fL4N x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB9305.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(366004)(396003)(376002)(39860400002)(346002)(8936002)(85182001)(4326008)(30864003)(36756003)(110136005)(6506007)(71200400001)(54906003)(38100700002)(41300700001)(66476007)(64756008)(6512007)(2906002)(26005)(5660300002)(2616005)(8676002)(316002)(66946007)(91956017)(66556008)(38070700005)(82960400001)(6486002)(86362001)(83380400001)(122000001)(478600001)(76116006)(1076003)(186003)(107886003)(66446008)(559001)(579004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?ifMBOg4sKxmKsUe3v1TnnXCRVrDb?= =?utf-8?q?LhawoFuMzc46RK9kZd3ghUKE2T1fnwson3iKgmUCrt8AXWmOBLT1yJFmU0x37irEF?= =?utf-8?q?2ZhCThZXEUjPpPm2g34Fk0X/BnDUFtdhBQ3iayoIUjjNBLSstCwl9JciF6vVi1wHO?= =?utf-8?q?U3tSEJPuI+u9SEmG4r1ZeoJJ3NzFpBkt1GX0ESq6Cn+4BeI89f5F2+XH9znDfS2QQ?= =?utf-8?q?l8GrNeM3wN4snbpaDe8o+mSiuwPC1akU1VBNCGKw0rbZ/pxRHCqeVK0u3zyGujoTm?= =?utf-8?q?VF4DjYRFEQm/j1BJ0OfcJ81x8h1OBhpvFs9KP3GXnBbwUV/PsjWgklasyliRQQVZh?= =?utf-8?q?czupt1+ubk10UkJIzHPIPD9jQ9a8WeBCAKfY5yCwGvbtqfSORV+mjxcPr8J0BIMJm?= =?utf-8?q?+Xgy17bWHQZbY+XeD3IjTETdGMYlEcOH4HxmiTyqg8Cr2lyjO8zWNMWhYBnlwRAz8?= =?utf-8?q?lGO+ECWZwj64AshQpPFUwudxzNTGDT96kzl8ZjhHpIZ0fl2P5duqpDZ3ODlfRsZ+s?= =?utf-8?q?hg5vbsyWN9kI/dfW5tU35FWCyj0DM8pnt3gkJS0eWz+mKUwQ4h4SReVzTsDTaOJNV?= =?utf-8?q?hgpeKgRQ9jzrXdHNeSw2MkgQudOXW8c5sAuuf6wXmCM486bwx702a/KdExxVeSI6c?= =?utf-8?q?zvWPYOGNn9yIyzT1KJUq8ewUZU+f0fN9Bs44TwprC/9eWExMgjKOEQcj2PsnWstxE?= =?utf-8?q?Yfc98bQyPgKX+o7kXw0mosZT4vLMyOx2fRt4uFC5gAX57dL2ESlr2Hjh2lTRK3cTd?= =?utf-8?q?WFKg5gTH7eQ57Cuh++RR64oT5zQIcjCXWv+tG0hkIZwKFYyOeAltU3FKjLQfUP4h/?= =?utf-8?q?nnXit0HWqvIs7g+zNP09euGTOdj8rp0Xpjv91+mGcNYtMeCAiBIlH+nxq2lt5LDV1?= =?utf-8?q?Zb2kbHK91j7gGtUXxakis7r7Iu2JlrnYXmAvwdwv/mnDaQsBYHblka205X1acQs/i?= =?utf-8?q?W0gXJhQu4iXficaxylbdRAwLshg1qg4odCeTrQBVG9tE0rObfNMrxFxopYtbJXhwz?= =?utf-8?q?Vb1wdb2tJ76apO/bl/DZrXvuvpuXAmrlZ6E2EVFCf+0Nwz462QWHw4WRJf44HOnfV?= =?utf-8?q?90HvWJOdH6z9VDVDDICD6KTgru4ThmLx7Pl0ZArcawVQnNTonl749d/krDlRzMjhN?= =?utf-8?q?PGRNZ6ffeC3Dvm01uiERZk7kwajQ56UoGgCIAab35BSJKJ7VnB8/Xj8jakjU/Zdu9?= =?utf-8?q?0oAGBp5otUajLy7xWo2Ui12RYKEiPPtMAsWbmvnUUxxqgoglE6STJdQ4zFT0MpltQ?= =?utf-8?q?vDt+jfVci45oTH+qJ0Ko8KIxb5Ffun1LpWxONrwVBlZfFPQBQ0q06pq4Zu+4qo+sQ?= =?utf-8?q?unBeft63nvevl3A0qeE4YDTe+x/9Tg6c2MFfPNX3zEIsEJI247qKqfj0EWnb2bXRp?= =?utf-8?q?fWajznWYA3adOXUxc8+ER+uBzCr4hUMADblJeR5BFJqpOoH3sKp8v1ncjEENqfaaD?= =?utf-8?q?CASREjk+XAldmTnp0+rUkJz/oNRfVHc2dy1CpNP7VxIvIzHvtQp9Xq1rIPyBjbEpG?= =?utf-8?q?HoW6ahK+vvIfejv+xaHq/3m6jXxHGtMVgQ=3D=3D?= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: fujitsu.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB9305.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b48a59b7-bff0-48e3-3f75-08da63df7ae3 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2022 08:21:11.6291 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a19f121d-81e1-4858-a9d8-736e267fd4c7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nsIH8E94IZR54wSjBhAl8AP9yHtvTlVzF9JoI/AGdl8baxWuoT2hVHwFv2ZUt6QPeqUrDg3NUrcR8/ROf256gA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB3691 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Some test cases or test groups have rather large number of test run requirements and then they may have multiple skip reasons. However, blktests can report only single skip reason. To know all of the skip reasons, we need to repeat skip reason resolution and blktests run. This is a troublesome work. In this patch, we add skip reasons to SKIP_REASONS array, then all of the skip reasons will be printed by iterating SKIP_REASONS at one shot run. Most of the works are done by following script: sed -i 's/SKIP_REASON/SKIP_REASONS/' $(git ls-files) git grep -h 'SKIP_REASONS=' | awk -F'SKIP_REASONS=' '{print $2}' | sort | uniq | while read -r r do s="SKIP_REASONS=$r" f=$(git grep -l "$s") sed -i "s@$s@SKIP_REASONS+=($r)@" $f done Signed-off-by: Li Zhijian Reviewed-by: Bart Van Assche --- V3: update description in new --- check | 27 ++++++++++++-------- common/cgroup | 6 ++--- common/cpuhotplug | 2 +- common/fio | 4 +-- common/iopoll | 10 ++++---- common/multipath-over-rdma | 4 +-- common/null_blk | 2 +- common/rc | 50 +++++++++++++++++++------------------- common/shellcheck | 2 +- new | 50 ++++++++++++++++++++------------------ tests/block/030 | 2 +- tests/loop/rc | 2 +- tests/meta/007 | 2 +- tests/meta/008 | 2 +- tests/meta/013 | 2 +- tests/meta/014 | 2 +- tests/meta/015 | 2 +- tests/meta/rc | 4 +-- tests/nbd/rc | 4 +-- tests/nvme/rc | 10 ++++---- tests/nvmeof-mp/rc | 7 +++--- tests/scsi/rc | 4 +-- tests/srp/012 | 2 +- tests/srp/rc | 6 ++--- tests/zbd/004 | 2 +- tests/zbd/rc | 4 +-- 26 files changed, 111 insertions(+), 103 deletions(-) diff --git a/check b/check index a0c27d92c8fe..e6c321c388cf 100755 --- a/check +++ b/check @@ -225,9 +225,16 @@ _output_status() { echo "]" } +_output_skip_reasons() +{ + for reason in "${SKIP_REASONS[@]}"; do + echo " $reason" + done +} + _output_notrun() { _output_status "$1" "not run" - echo " $SKIP_REASON" + _output_skip_reasons } _output_last_test_run() { @@ -288,7 +295,7 @@ _output_test_run() { } | column -t -s $'\t' if [[ $status = "not run" ]]; then - echo " $SKIP_REASON" + _output_skip_reasons fi } @@ -343,7 +350,7 @@ _call_test() { # Remove leftovers from last time. rm -f "${seqres}" "${seqres}."* - if [[ -v SKIP_REASON ]]; then + if [[ -v SKIP_REASONS ]]; then TEST_RUN["status"]="not run" else if [[ -w /dev/kmsg ]]; then @@ -371,7 +378,7 @@ _call_test() { _cleanup - if [[ -v SKIP_REASON ]]; then + if [[ -v SKIP_REASONS ]]; then TEST_RUN["status"]="not run" elif ! diff "tests/${TEST_NAME}.out" "${seqres}.out" >/dev/null; then mv "${seqres}.out" "${seqres}.out.bad" @@ -493,10 +500,10 @@ _run_test() { TEST_DEV_PART_SYSFS="${TEST_DEV_PART_SYSFS_DIRS["$TEST_DEV"]}" local unset_skip_reason=0 - if [[ ! -v SKIP_REASON ]]; then + if [[ ! -v SKIP_REASONS ]]; then unset_skip_reason=1 if (( !CAN_BE_ZONED )) && _test_dev_is_zoned; then - SKIP_REASON="${TEST_DEV} is a zoned block device" + SKIP_REASONS+=("${TEST_DEV} is a zoned block device") elif declare -fF device_requires >/dev/null; then device_requires fi @@ -506,7 +513,7 @@ _run_test() { ret=1 fi if (( unset_skip_reason )); then - unset SKIP_REASON + unset SKIP_REASONS fi done @@ -530,7 +537,7 @@ _run_group() { if declare -fF group_requires >/dev/null; then group_requires - if [[ -v SKIP_REASON ]]; then + if [[ -v SKIP_REASONS ]]; then _output_notrun "${group}/***" return 0 fi @@ -544,10 +551,10 @@ _run_group() { # shellcheck disable=SC2034 TEST_DEV_PART_SYSFS="${TEST_DEV_PART_SYSFS_DIRS["$TEST_DEV"]}" group_device_requires - if [[ -v SKIP_REASON ]]; then + if [[ -v SKIP_REASONS ]]; then _output_notrun "${group}/*** => $(basename "$TEST_DEV")" unset "TEST_DEVS[$i]" - unset SKIP_REASON + unset SKIP_REASONS fi done # Fix the array indices. diff --git a/common/cgroup b/common/cgroup index c34bffd5d299..38511f0319d5 100644 --- a/common/cgroup +++ b/common/cgroup @@ -31,7 +31,7 @@ _exit_cgroup2() _have_cgroup2() { if [[ -z $(_cgroup2_base_dir) ]]; then - SKIP_REASON="cgroup2 is not mounted" + SKIP_REASONS+=("cgroup2 is not mounted") return 1 fi return 0 @@ -46,7 +46,7 @@ _have_cgroup2_controller() dir="$(_cgroup2_base_dir)" if ! grep -q "$controller" "$dir/cgroup.controllers"; then - SKIP_REASON="no support for $controller cgroup controller; if it is enabled, you may need to boot with cgroup_no_v1=$controller" + SKIP_REASONS+=("no support for $controller cgroup controller; if it is enabled, you may need to boot with cgroup_no_v1=$controller") return 1 fi } @@ -63,7 +63,7 @@ _have_cgroup2_controller_file() echo "+$controller" > "$dir/cgroup.subtree_control" if [[ ! -f $dir/blktests/$file ]]; then rmdir "$dir/blktests" - SKIP_REASON="cgroup file $file doesn't exist" + SKIP_REASONS+=("cgroup file $file doesn't exist") return 1 fi rmdir "$dir/blktests" diff --git a/common/cpuhotplug b/common/cpuhotplug index d3aabfa75831..7facd0de955e 100644 --- a/common/cpuhotplug +++ b/common/cpuhotplug @@ -24,7 +24,7 @@ _have_cpu_hotplug() { done if [[ ${#ALL_CPUS[@]} -eq 1 || ${#HOTPLUGGABLE_CPUS[@]} -eq 0 ]]; then - SKIP_REASON="CPU hotplugging is not supported" + SKIP_REASONS+=("CPU hotplugging is not supported") return 1 fi return 0 diff --git a/common/fio b/common/fio index 94c65c107a14..bed76d555b2a 100644 --- a/common/fio +++ b/common/fio @@ -11,7 +11,7 @@ _have_fio() { return 1 fi if ! fio --parse-only --terse-version=4 >/dev/null 2>&1; then - SKIP_REASON="Fio version too old (does not support --terse-version=4)" + SKIP_REASONS+=("Fio version too old (does not support --terse-version=4)") return 1 fi return 0 @@ -20,7 +20,7 @@ _have_fio() { _have_fio_zbd_zonemode() { _have_fio || return $? if ! fio --cmdhelp=zonemode 2>&1 | grep -q zbd; then - SKIP_REASON="Fio version too old (does not support --zonemode=zbd)" + SKIP_REASONS+=("Fio version too old (does not support --zonemode=zbd)") return 1 fi return 0 diff --git a/common/iopoll b/common/iopoll index dfdd2cf6f08f..34c021161bf4 100644 --- a/common/iopoll +++ b/common/iopoll @@ -11,7 +11,7 @@ _have_fio_with_poll() { return 1 fi if ! fio --parse-only --name=test --ioengine=pvsync2 --hipri=1 1>/dev/null 2>&1; then - SKIP_REASON="Fio does not support polling" + SKIP_REASONS+=("Fio does not support polling") return 1 fi return 0 @@ -20,11 +20,11 @@ _have_fio_with_poll() { _require_test_dev_supports_io_poll() { local old_io_poll if ! old_io_poll="$(cat "${TEST_DEV_SYSFS}/queue/io_poll" 2>/dev/null)"; then - SKIP_REASON="kernel does not support polling" + SKIP_REASONS+=("kernel does not support polling") return 1 fi if ! echo "$old_io_poll" >"${TEST_DEV_SYSFS}/queue/io_poll" 2>/dev/null; then - SKIP_REASON="$TEST_DEV does not support polling" + SKIP_REASONS+=("$TEST_DEV does not support polling") return 1 fi return 0 @@ -33,11 +33,11 @@ _require_test_dev_supports_io_poll() { _require_test_dev_supports_io_poll_delay() { local old_io_poll_delay if ! old_io_poll_delay="$(cat "${TEST_DEV_SYSFS}/queue/io_poll_delay" 2>/dev/null)"; then - SKIP_REASON="kernel does not support hybrid polling" + SKIP_REASONS+=("kernel does not support hybrid polling") return 1 fi if ! echo "$old_io_poll_delay" >"${TEST_DEV_SYSFS}/queue/io_poll_delay" 2>/dev/null; then - SKIP_REASON="$TEST_DEV does not support hybrid polling" + SKIP_REASONS+=("$TEST_DEV does not support hybrid polling") return 1 fi return 0 diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma index 8edcf3921a7f..b8214ad52ac6 100644 --- a/common/multipath-over-rdma +++ b/common/multipath-over-rdma @@ -21,7 +21,7 @@ fi _have_legacy_dm() { _have_kernel_config_file || return if ! _check_kernel_option DM_MQ_DEFAULT; then - SKIP_REASON="legacy device mapper support is missing" + SKIP_REASONS+=("legacy device mapper support is missing") return 1 fi } @@ -53,7 +53,7 @@ _multipathd_version_ge() { if version_le "$min_ver" "$mp_ver"; then return 0 fi - SKIP_REASON="Need multipathd version $min_ver; found multipathd version $mp_ver." + SKIP_REASONS+=("Need multipathd version $min_ver; found multipathd version $mp_ver.") return 1 } diff --git a/common/null_blk b/common/null_blk index 918ba443b983..52eb48659d8d 100644 --- a/common/null_blk +++ b/common/null_blk @@ -24,7 +24,7 @@ _init_null_blk() { if (( RUN_FOR_ZONED )); then zoned="zoned=1"; fi if ! modprobe -r null_blk || ! modprobe null_blk "$@" "${zoned}" ; then - SKIP_REASON="requires modular null_blk" + SKIP_REASONS+=("requires modular null_blk") return 1 fi diff --git a/common/rc b/common/rc index bf6cd10cfb7e..01df6fa53641 100644 --- a/common/rc +++ b/common/rc @@ -22,7 +22,7 @@ _divide_timeout() { _have_root() { if [[ $EUID -ne 0 ]]; then - SKIP_REASON="not running as root" + SKIP_REASONS+=("not running as root") return 1 fi return 0 @@ -33,7 +33,7 @@ _have_driver() local modname="${1/-/_}" if [ ! -d "/sys/module/${modname}" ] && ! modprobe -q "${modname}"; then - SKIP_REASON="driver ${modname} is not available" + SKIP_REASONS+=("driver ${modname} is not available") return 1 fi @@ -50,10 +50,10 @@ _have_modules() { fi done if [[ ${#missing} -gt 1 ]]; then - SKIP_REASON="the following modules are not available: ${missing[*]}" + SKIP_REASONS+=("the following modules are not available: ${missing[*]}") return 1 elif [[ ${#missing} -eq 1 ]]; then - SKIP_REASON="${missing[0]} module is not available" + SKIP_REASONS+=("${missing[0]} module is not available") return 1 fi return 0 @@ -67,7 +67,7 @@ _have_module_param() { fi if ! modinfo -F parm -0 "$1" | grep -q -z "^$2:"; then - SKIP_REASON="$1 module does not have parameter $2" + SKIP_REASONS+=("$1 module does not have parameter $2") return 1 fi return 0 @@ -89,7 +89,7 @@ _have_module_param_value() { value=$(cat "/sys/module/$modname/parameters/$param") if [[ "${value}" != "$expected_value" ]]; then - SKIP_REASON="$modname module parameter $param must be set to $expected_value" + SKIP_REASONS+=("$modname module parameter $param must be set to $expected_value") return 1 fi @@ -100,7 +100,7 @@ _have_program() { if command -v "$1" >/dev/null 2>&1; then return 0 fi - SKIP_REASON="$1 is not available" + SKIP_REASONS+=("$1 is not available") return 1 } @@ -109,11 +109,11 @@ _have_iproute2() { local snapshot if ! snapshot=$(ip -V | sed 's/ip utility, iproute2-ss//'); then - SKIP_REASON="ip utility not found" + SKIP_REASONS+=("ip utility not found") return 1 fi if [[ "$snapshot" =~ ^[0-9]+$ && "$snapshot" -lt "$1" ]]; then - SKIP_REASON="ip utility too old" + SKIP_REASONS+=("ip utility too old") return 1 fi return 0 @@ -121,7 +121,7 @@ _have_iproute2() { _have_src_program() { if [[ ! -x "$SRCDIR/$1" ]]; then - SKIP_REASON="$1 was not built; run \`make\`" + SKIP_REASONS+=("$1 was not built; run \`make\`") return 1 fi return 0 @@ -135,7 +135,7 @@ _have_blktrace() { # CONFIG_BLK_DEV_IO_TRACE might still be disabled, but this is easier # to check. We can fix it if someone complains. if [[ ! -d /sys/kernel/debug/block ]]; then - SKIP_REASON="CONFIG_DEBUG_FS is not enabled" + SKIP_REASONS+=("CONFIG_DEBUG_FS is not enabled") return 1 fi _have_program blktrace @@ -143,7 +143,7 @@ _have_blktrace() { _have_configfs() { if ! findmnt -t configfs /sys/kernel/config >/dev/null; then - SKIP_REASON="configfs is not mounted at /sys/kernel/config" + SKIP_REASONS+=("configfs is not mounted at /sys/kernel/config") return 1 fi return 0 @@ -152,7 +152,7 @@ _have_configfs() { # Check if the specified kernel config files are available. _have_kernel_config_file() { if [[ ! -f /proc/config.gz && ! -f /boot/config-$(uname -r) ]]; then - SKIP_REASON="kernel $(uname -r) config not found" + SKIP_REASONS+=("kernel $(uname -r) config not found") return 1 fi @@ -180,7 +180,7 @@ _have_kernel_option() { _have_kernel_config_file || return if ! _check_kernel_option "$opt"; then - SKIP_REASON="kernel option $opt has not been enabled" + SKIP_REASONS+=("kernel option $opt has not been enabled") return 1 fi @@ -195,7 +195,7 @@ _have_kver() { IFS='.' read -r a b c < <(uname -r | sed 's/-.*//') if [ $((a * 65536 + b * 256 + c)) -lt $((d * 65536 + e * 256 + f)) ]; then - SKIP_REASON="Kernel version too old" + SKIP_REASONS+=("Kernel version too old") return 1 fi } @@ -203,7 +203,7 @@ _have_kver() { _have_tracefs() { stat /sys/kernel/debug/tracing/trace > /dev/null 2>&1 if ! findmnt -t tracefs /sys/kernel/debug/tracing >/dev/null; then - SKIP_REASON="tracefs is not mounted at /sys/kernel/debug/tracing" + SKIP_REASONS+=("tracefs is not mounted at /sys/kernel/debug/tracing") return 1 fi return 0 @@ -213,7 +213,7 @@ _have_tracepoint() { local event=$1 if [[ ! -d /sys/kernel/debug/tracing/events/${event} ]]; then - SKIP_REASON="tracepoint ${event} does not exist" + SKIP_REASONS+=("tracepoint ${event} does not exist") return 1 fi return 0 @@ -222,7 +222,7 @@ _have_tracepoint() { _have_fs() { modprobe "$1" >/dev/null 2>&1 if [[ ! -d "/sys/fs/$1" ]]; then - SKIP_REASON="kernel does not support filesystem $1" + SKIP_REASONS+=("kernel does not support filesystem $1") return 1 fi } @@ -231,7 +231,7 @@ _require_min_cpus() { if [[ $(nproc) -ge $1 ]]; then return 0 fi - SKIP_REASON="minimum $1 cpus required" + SKIP_REASONS+=("minimum $1 cpus required") return 1 } @@ -241,7 +241,7 @@ _test_dev_is_rotational() { _require_test_dev_is_rotational() { if ! _test_dev_is_rotational; then - SKIP_REASON="$TEST_DEV is not rotational" + SKIP_REASONS+=("$TEST_DEV is not rotational") return 1 fi return 0 @@ -253,7 +253,7 @@ _test_dev_can_discard() { _require_test_dev_can_discard() { if ! _test_dev_can_discard; then - SKIP_REASON="$TEST_DEV does not support discard" + SKIP_REASONS+=("$TEST_DEV does not support discard") return 1 fi return 0 @@ -291,7 +291,7 @@ _require_test_dev_is_pci() { fi fi - SKIP_REASON="$TEST_DEV is not a PCI device" + SKIP_REASONS+=("$TEST_DEV is not a PCI device") return 1 fi return 0 @@ -316,7 +316,7 @@ _require_test_dev_in_hotplug_slot() { local slt_cap slt_cap="$(setpci -s "${parent}" CAP_EXP+14.w)" if [[ $((0x${slt_cap} & 0x60)) -ne $((0x60)) ]]; then - SKIP_REASON="$TEST_DEV is not in a hot pluggable slot" + SKIP_REASONS+=("$TEST_DEV is not in a hot pluggable slot") return 1 fi return 0 @@ -349,7 +349,7 @@ _test_dev_max_open_active_zones() { _require_test_dev_is_partition() { if ! _test_dev_is_partition; then - SKIP_REASON="${TEST_DEV} is not a partition device" + SKIP_REASONS+=("${TEST_DEV} is not a partition device") return 1 fi return 0 @@ -391,7 +391,7 @@ unload_module() { _have_writeable_kmsg() { if [[ ! -w /dev/kmsg ]]; then - SKIP_REASON="cannot write to /dev/kmsg" + SKIP_REASONS+=("cannot write to /dev/kmsg") return 1 fi return 0 diff --git a/common/shellcheck b/common/shellcheck index 72900b030121..8c324bd3113a 100644 --- a/common/shellcheck +++ b/common/shellcheck @@ -6,5 +6,5 @@ # Suppress unused global variable warnings. _silence_sc2034() { - echo "$CAN_BE_ZONED $CGROUP2_DIR $CHECK_DMESG $DESCRIPTION $DMESG_FILTER $FIO_PERF_FIELDS $FIO_PERF_PREFIX $QUICK $SKIP_REASON ${TEST_RUN[*]} $TIMED" > /dev/null + echo "$CAN_BE_ZONED $CGROUP2_DIR $CHECK_DMESG $DESCRIPTION $DMESG_FILTER $FIO_PERF_FIELDS $FIO_PERF_PREFIX $QUICK $SKIP_REASONS ${TEST_RUN[*]} $TIMED" > /dev/null } diff --git a/new b/new index 41f8b8d5468b..817656fac97b 100755 --- a/new +++ b/new @@ -64,29 +64,31 @@ if [[ ! -e tests/${group} ]]; then # TODO: if this test group has any extra requirements, it should define a # group_requires() function. If tests in this group cannot be run, -# group_requires() should set the \$SKIP_REASON variable. +# group_requires() should add strings to the \$SKIP_REASONS array which +# describe why the group cannot be run. # # Usually, group_requires() just needs to check that any necessary programs and # kernel features are available using the _have_foo helpers. If -# group_requires() sets \$SKIP_REASON, all tests in this group will be skipped. +# group_requires() adds strings to \$SKIP_REASONS, all tests in this group will +# be skipped. group_requires() { _have_root } # TODO: if this test group has extra requirements for what devices it can be # run on, it should define a group_device_requires() function. If tests in this -# group cannot be run on the test device, it should set the \$SKIP_REASON -# variable. \$TEST_DEV is the full path of the block device (e.g., /dev/nvme0n1 -# or /dev/sda1), and \$TEST_DEV_SYSFS is the sysfs path of the disk (not the -# partition, e.g., /sys/block/nvme0n1 or /sys/block/sda). If the target device -# is a partition device, \$TEST_DEV_PART_SYSFS is the sysfs path of the -# partition device (e.g., /sys/block/nvme0n1/nvme0n1p1 or /sys/block/sda/sda1). -# Otherwise, \$TEST_DEV_PART_SYSFS is an empty string. +# group cannot be run on the test device, it should adds strings to +# \$SKIP_REASONS. \$TEST_DEV is the full path of the block device (e.g., +# /dev/nvme0n1 # or /dev/sda1), and \$TEST_DEV_SYSFS is the sysfs path of the +# disk (not the # partition, e.g., /sys/block/nvme0n1 or /sys/block/sda). If +# the target device is a partition device, \$TEST_DEV_PART_SYSFS is the sysfs +# path of the partition device (e.g., /sys/block/nvme0n1/nvme0n1p1 or +# /sys/block/sda/sda1). Otherwise, \$TEST_DEV_PART_SYSFS is an empty string. # # Usually, group_device_requires() just needs to check that the test device is # the right type of hardware or supports any necessary features using the -# _require_test_dev_foo helpers. If group_device_requires() sets \$SKIP_REASON, -# all tests in this group will be skipped on that device. +# _require_test_dev_foo helpers. If group_device_requires() adds strings to +# \$SKIP_REASONS, all tests in this group will be skipped on that device. # group_device_requires() { # _require_test_dev_is_foo && _require_test_dev_supports_bar # } @@ -149,28 +151,28 @@ DESCRIPTION="" # CAN_BE_ZONED=1 # TODO: if this test has any extra requirements, it should define a requires() -# function. If the test cannot be run, requires() should set the \$SKIP_REASON -# variable. Usually, requires() just needs to check that any necessary programs -# and kernel features are available using the _have_foo helpers. If requires() -# sets \$SKIP_REASON, the test is skipped. +# function. If the test cannot be run, requires() should add strings to +# \$SKIP_REASONS. Usually, requires() just needs to check that any necessary +# programs and kernel features are available using the _have_foo helpers. +# If requires() adds strings to \$SKIP_REASONS, the test is skipped. # requires() { # _have_foo # } # TODO: if this test has extra requirements for what devices it can be run on, # it should define a device_requires() function. If this test cannot be run on -# the test device, it should set \$SKIP_REASON. \$TEST_DEV is the full path of -# the block device (e.g., /dev/nvme0n1 or /dev/sda1), and \$TEST_DEV_SYSFS is -# the sysfs path of the disk (not the partition, e.g., /sys/block/nvme0n1 or -# /sys/block/sda). If the target device is a partition device, -# \$TEST_DEV_PART_SYSFS is the sysfs path of the partition device (e.g., -# /sys/block/nvme0n1/nvme0n1p1 or /sys/block/sda/sda1). Otherwise, +# the test device, it should add strings to \$SKIP_REASONS. \$TEST_DEV is the +# full path of the block device (e.g., /dev/nvme0n1 or /dev/sda1), and +# \$TEST_DEV_SYSFS is the sysfs path of the disk (not the partition, e.g., +# /sys/block/nvme0n1 or /sys/block/sda). If the target device is a partition +# device, \$TEST_DEV_PART_SYSFS is the sysfs path of the partition device +# (e.g., /sys/block/nvme0n1/nvme0n1p1 or /sys/block/sda/sda1). Otherwise, # \$TEST_DEV_PART_SYSFS is an empty string. # # Usually, device_requires() just needs to check that the test device is the # right type of hardware or supports any necessary features using the -# _require_test_dev_foo helpers. If device_requires() sets \$SKIP_REASON, the -# test will be skipped on that device. +# _require_test_dev_foo helpers. If device_requires() adds strings to +# \$SKIP_REASONS, the test will be skipped on that device. # device_requires() { # _require_test_dev_is_foo && _require_test_dev_supports_bar # } @@ -185,7 +187,7 @@ DESCRIPTION="" # failure. You should prefer letting the test fail because of broken output # over, say, checking the exit status of every command you run. # -# If the test cannot be run, this function may set the \$SKIP_REASON variable +# If the test cannot be run, this function may add strings to \$SKIP_REASONS # and return. In that case, the return value and output are ignored, and the # test is considered skipped. This should only be done when the requirements # can only be detected with a non-trivial amount of setup; use diff --git a/tests/block/030 b/tests/block/030 index f08f7720bc46..7a0712b5b800 100755 --- a/tests/block/030 +++ b/tests/block/030 @@ -45,7 +45,7 @@ test() { { nproc > $sq; } >>"$FULL" 2>&1 done else - SKIP_REASON="Skipping test because $sq cannot be modified" + SKIP_REASONS+=("Skipping test because $sq cannot be modified") fi rmdir /sys/kernel/config/nullb/nullb0 _exit_null_blk diff --git a/tests/loop/rc b/tests/loop/rc index 001292af93ee..c9496563048f 100644 --- a/tests/loop/rc +++ b/tests/loop/rc @@ -13,7 +13,7 @@ group_requires() { _have_loop_set_block_size() { src/loblksize "$(losetup -f)" 512 &>/dev/null if [[ $? -eq 2 ]]; then - SKIP_REASON="kernel does not support LOOP_SET_BLOCK_SIZE" + SKIP_REASONS+=("kernel does not support LOOP_SET_BLOCK_SIZE") return 1 fi return 0 diff --git a/tests/meta/007 b/tests/meta/007 index ae57a67e9631..30b67588e05c 100755 --- a/tests/meta/007 +++ b/tests/meta/007 @@ -9,7 +9,7 @@ DESCRIPTION="skip in requires()" requires() { - SKIP_REASON="(╯°□°)╯︵ ┻━┻" + SKIP_REASONS+=("(╯°□°)╯︵ ┻━┻") } test() { diff --git a/tests/meta/008 b/tests/meta/008 index 6d7b032ad784..ec3d7891b762 100755 --- a/tests/meta/008 +++ b/tests/meta/008 @@ -9,7 +9,7 @@ DESCRIPTION="skip in device_requires()" device_requires() { - SKIP_REASON="(╯°□°)╯︵ $TEST_DEV ┻━┻" + SKIP_REASONS+=("(╯°□°)╯︵ $TEST_DEV ┻━┻") } test_device() { diff --git a/tests/meta/013 b/tests/meta/013 index fd9f8e92bfd3..31fbbe0e3264 100755 --- a/tests/meta/013 +++ b/tests/meta/013 @@ -9,7 +9,7 @@ DESCRIPTION="skip test_device() in requires()" requires() { - SKIP_REASON="(╯°□°)╯︵ ┻━┻" + SKIP_REASONS+=("(╯°□°)╯︵ ┻━┻") } test_device() { diff --git a/tests/meta/014 b/tests/meta/014 index 0db1fb8005a2..26b6a4ee5f26 100755 --- a/tests/meta/014 +++ b/tests/meta/014 @@ -9,5 +9,5 @@ DESCRIPTION="skip in test()" test() { - SKIP_REASON="(╯°□°)╯︵ ┻━┻" + SKIP_REASONS+=("(╯°□°)╯︵ ┻━┻") } diff --git a/tests/meta/015 b/tests/meta/015 index 3dc588b42542..9592e32c97c9 100755 --- a/tests/meta/015 +++ b/tests/meta/015 @@ -9,5 +9,5 @@ DESCRIPTION="skip in test_device()" test_device() { - SKIP_REASON="(╯°□°)╯︵ ┻━┻" + SKIP_REASONS+=("(╯°□°)╯︵ ┻━┻") } diff --git a/tests/meta/rc b/tests/meta/rc index 833e87250efd..3a472be02ddc 100644 --- a/tests/meta/rc +++ b/tests/meta/rc @@ -8,13 +8,13 @@ group_requires() { if [[ "${META_REQUIRES_SKIP:-}" ]]; then - SKIP_REASON="META_REQUIRES_SKIP was set" + SKIP_REASONS+=("META_REQUIRES_SKIP was set") fi } group_device_requires() { if [[ "${META_DEVICE_REQUIRES_SKIP:-}" ]]; then - SKIP_REASON="META_DEVICE_REQUIRES_SKIP was set" + SKIP_REASONS+=("META_DEVICE_REQUIRES_SKIP was set") fi } diff --git a/tests/nbd/rc b/tests/nbd/rc index 118553c1d192..5cfb2cc6f64c 100644 --- a/tests/nbd/rc +++ b/tests/nbd/rc @@ -21,7 +21,7 @@ _have_nbd() { return 1 fi if ! nbd-client --help 2>&1 | grep -q -- -L; then - SKIP_REASON="nbd-client does not have -nonetlink/-L option" + SKIP_REASONS+=("nbd-client does not have -nonetlink/-L option") return 1 fi return 0 @@ -35,7 +35,7 @@ _have_nbd_netlink() { return 1 fi if ! genl-ctrl-list | grep -q nbd; then - SKIP_REASON="nbd does not support netlink" + SKIP_REASONS+=("nbd does not support netlink") return 1 fi return 0 diff --git a/tests/nvme/rc b/tests/nvme/rc index 4bebbc762cbb..c5725ed55eb3 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -35,7 +35,7 @@ _nvme_requires() { _have_driver rdma_rxe || _have_driver siw ;; *) - SKIP_REASON="unsupported nvme_trtype=${nvme_trtype}" + SKIP_REASONS+=("unsupported nvme_trtype=${nvme_trtype}") return 1 esac @@ -51,7 +51,7 @@ _nvme_requires() { # ignore for non ip transports if [[ "${nvme_trtype}" == "tcp" || "${nvme_trtype}" == "rdma" ]]; then - SKIP_REASON="unsupported nvme_adrfam=${nvme_adrfam}" + SKIP_REASONS+=("unsupported nvme_adrfam=${nvme_adrfam}") return 1 fi esac @@ -72,7 +72,7 @@ NVMET_CFS="/sys/kernel/config/nvmet/" _require_test_dev_is_nvme() { if ! readlink -f "$TEST_DEV_SYSFS/device" | grep -q nvme; then - SKIP_REASON="$TEST_DEV is not a NVMe device" + SKIP_REASONS+=("$TEST_DEV is not a NVMe device") return 1 fi return 0 @@ -80,7 +80,7 @@ _require_test_dev_is_nvme() { _require_nvme_trtype_is_loop() { if [[ "${nvme_trtype}" != "loop" ]]; then - SKIP_REASON="nvme_trtype=${nvme_trtype} is not supported in this test" + SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test") return 1 fi return 0 @@ -88,7 +88,7 @@ _require_nvme_trtype_is_loop() { _require_nvme_trtype_is_fabrics() { if [[ "${nvme_trtype}" == "pci" ]]; then - SKIP_REASON="nvme_trtype=${nvme_trtype} is not supported in this test" + SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test") return 1 fi return 0 diff --git a/tests/nvmeof-mp/rc b/tests/nvmeof-mp/rc index 2ae80c3d47e8..b7ca611f3ff3 100755 --- a/tests/nvmeof-mp/rc +++ b/tests/nvmeof-mp/rc @@ -20,8 +20,7 @@ group_requires() { # option with multipathing enabled in the nvme_core kernel module. if _check_kernel_option NVME_MULTIPATH && \ _have_module_param_value nvme_core multipath Y; then - SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config \ -and multipathing has been enabled in the nvme_core kernel module" + SKIP_REASONS+=("CONFIG_NVME_MULTIPATH has been set in .config and multipathing has been enabled in the nvme_core kernel module") return fi @@ -56,14 +55,14 @@ and multipathing has been enabled in the nvme_core kernel module" # shellcheck disable=SC2043 for name in multipathd; do if pidof "$name" >/dev/null; then - SKIP_REASON="$name must be stopped before the nvmeof-mp tests are run" + SKIP_REASONS+=("$name must be stopped before the nvmeof-mp tests are run") return fi done if [ -e /etc/multipath.conf ] && ! diff -q /etc/multipath.conf tests/nvmeof-mp/multipath.conf >&/dev/null then - SKIP_REASON="/etc/multipath.conf already exists" + SKIP_REASONS+=("/etc/multipath.conf already exists") return fi } diff --git a/tests/scsi/rc b/tests/scsi/rc index 0751e77c7635..3b4a33c4b203 100644 --- a/tests/scsi/rc +++ b/tests/scsi/rc @@ -20,7 +20,7 @@ _have_scsi_generic() { _require_test_dev_is_scsi() { if [[ ! -d ${TEST_DEV_SYSFS}/device/scsi_device ]]; then - SKIP_REASON="$TEST_DEV is not a SCSI device" + SKIP_REASONS+=("$TEST_DEV is not a SCSI device") return 1 fi return 0 @@ -28,7 +28,7 @@ _require_test_dev_is_scsi() { _require_test_dev_is_scsi_disk() { if [[ ! -d ${TEST_DEV_SYSFS}/device/scsi_disk ]]; then - SKIP_REASON="$TEST_DEV is not a SCSI disk" + SKIP_REASONS+=("$TEST_DEV is not a SCSI disk") return 1 fi return 0 diff --git a/tests/srp/012 b/tests/srp/012 index b862ac46c28c..1b34393600ce 100755 --- a/tests/srp/012 +++ b/tests/srp/012 @@ -16,7 +16,7 @@ test_io_schedulers() { done for mq in y n; do if [ $mq = n ] && ! _have_legacy_dm; then - unset SKIP_REASON + unset SKIP_REASONS continue fi use_blk_mq ${mq} ${mq} || return $? diff --git a/tests/srp/rc b/tests/srp/rc index d44082af39de..94ee97cd6d97 100755 --- a/tests/srp/rc +++ b/tests/srp/rc @@ -32,7 +32,7 @@ group_requires() { _have_configfs || return if is_lio_configured; then - SKIP_REASON="LIO must be unloaded before the SRP tests are run" + SKIP_REASONS+=("LIO must be unloaded before the SRP tests are run") return fi required_modules=( @@ -74,14 +74,14 @@ group_requires() { for name in srp_daemon multipathd; do if pidof "$name" >/dev/null; then - SKIP_REASON="$name must be stopped before the SRP tests are run" + SKIP_REASONS+=("$name must be stopped before the SRP tests are run") return fi done if [ -e /etc/multipath.conf ] && ! diff -q /etc/multipath.conf tests/srp/multipath.conf >&/dev/null then - SKIP_REASON="/etc/multipath.conf already exists" + SKIP_REASONS+=("/etc/multipath.conf already exists") return fi } diff --git a/tests/zbd/004 b/tests/zbd/004 index f09ee31a72d7..17c860e248d5 100755 --- a/tests/zbd/004 +++ b/tests/zbd/004 @@ -47,7 +47,7 @@ test_device() { # Find target sequential required zones and reset write pointers _get_blkzone_report "${TEST_DEV}" || return $? if ! idx=$(_find_two_contiguous_seq_zones cap_eq_len); then - SKIP_REASON="No contiguous sequential write required zones" + SKIP_REASONS+=("No contiguous sequential write required zones") _put_blkzone_report return fi diff --git a/tests/zbd/rc b/tests/zbd/rc index fea55d64ea37..77d3ec236607 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -19,7 +19,7 @@ group_requires() { group_device_requires() { if ! _test_dev_is_zoned; then - SKIP_REASON="${TEST_DEV} is not a zoned block device" + SKIP_REASONS+=("${TEST_DEV} is not a zoned block device") return fi } @@ -287,7 +287,7 @@ _test_dev_is_dm() { _require_test_dev_is_logical() { if ! _test_dev_is_partition && ! _test_dev_is_dm; then - SKIP_REASON="$TEST_DEV is not a logical device" + SKIP_REASONS+=("$TEST_DEV is not a logical device") return 1 fi return 0