From patchwork Mon Aug 23 07:34:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 12452065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA735C4338F for ; Mon, 23 Aug 2021 07:34:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3071961078 for ; Mon, 23 Aug 2021 07:34:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3071961078 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8BA1B8D0001; Mon, 23 Aug 2021 03:34:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 869C36B0072; Mon, 23 Aug 2021 03:34:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7318E8D0001; Mon, 23 Aug 2021 03:34:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 56B686B006C for ; Mon, 23 Aug 2021 03:34:58 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D1FB5181AEF2A for ; Mon, 23 Aug 2021 07:34:57 +0000 (UTC) X-FDA: 78505533834.29.A734154 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by imf26.hostedemail.com (Postfix) with ESMTP id 7EA4D20019DF for ; Mon, 23 Aug 2021 07:34:57 +0000 (UTC) Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 62EDF40763 for ; Mon, 23 Aug 2021 07:34:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1629704092; bh=vpW+MmQwHzNcx/1v6dYqOYxABjq4D11QeSkA/JaBIuk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=A+Oc9jNHMg86wkMYTdHM/gFMVeTHhsUr8T+vIjDhtVUMdjcBGzGEinslIoQ+qohVc niKRP9A+nACUHXQhDXaXaBopQzWoXV0byVqvrgof3aCyxoBsYkvpL8QO0QwMGi+ISZ NoGtyBrJnS6QSSFFaf3nUGLSR9Iwvmvjp7utRTf5u0/qCh8IHK53Uc30foLcQ6Ucn3 QWX7Ip4FRW7pR3z3SjYdHSmuRJ/Vx8OY8U+zu3S3dloQE1CLkbhSX76EDN9mRbhOyx JCoNP8jkzaub8hUpKls+SHwMIJiU2ART4/v4XA9sleBGN3Sx7llg2tFiivrT8KPbi2 AOWxOyJcNxXPQ== Received: by mail-pg1-f199.google.com with SMTP id q22-20020a63e956000000b002524787adb1so9882851pgj.3 for ; Mon, 23 Aug 2021 00:34:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vpW+MmQwHzNcx/1v6dYqOYxABjq4D11QeSkA/JaBIuk=; b=nt4nMVKr7qCaaIIm5Wc0cOTx7LrHWrVYwCo0vevm28pXFKjJV8fug8oRFBmGz8LC+y lirkDQrRDx2hIdnq3yuZ1udP3rBgjqda1t2GP5zTBzDn0ikpJ0yGgPIKpFtefvT6BnKv 1/Xrt1LE/N4YioIKG7bOR5irUw+D99W3eZF4bzrdiUIoWRzQvGLdm64H85rBLKfmi5LI ig0OTqcq0/HzA30EjLXYHoZxb6DcluOWOXRzTKbKpyma9iXgeZeo2bqwD/UXcBtrFqQW aNT8r7IMK57OZxDP+xB4dE5lgrFcVSut4Mu66xr05F6I1pIsLHO3oCbKQKBCX8r9ZYMy Nr6Q== X-Gm-Message-State: AOAM5314d3RI/K52mMXhoxhkXUFCUpldm2m1fR6kYFiJgGMxILr0MIXn xLbVVEkvbCPFscfEAwtpP78zdOQiL6RpNAkSRY7vRsddvSDzmbolJ6fxWKpK688vmyMAKNMaIfq 8PNt7FgqTwDRXCPR4NKmx3XHpv2A= X-Received: by 2002:a63:5d03:: with SMTP id r3mr30374602pgb.144.1629704090869; Mon, 23 Aug 2021 00:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLDs6LwEKpxKzmrkT2y3c9FukVNW8yy5ae0WiKKPyJAAGyulZ0vaYJ9HpM7spuQrBULhwB5A== X-Received: by 2002:a63:5d03:: with SMTP id r3mr30374590pgb.144.1629704090541; Mon, 23 Aug 2021 00:34:50 -0700 (PDT) Received: from localhost.localdomain (223-137-217-38.emome-ip.hinet.net. [223.137.217.38]) by smtp.gmail.com with ESMTPSA id r14sm14939447pff.106.2021.08.23.00.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 00:34:50 -0700 (PDT) From: Po-Hsu Lin To: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, skhan@linuxfoundation.org, po-hsu.lin@canonical.com Subject: [PATCH] selftests/vm: Use kselftest skip code for skipped tests Date: Mon, 23 Aug 2021 15:34:33 +0800 Message-Id: <20210823073433.37653-1-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=canonical.com header.s=20210705 header.b=A+Oc9jNH; spf=pass (imf26.hostedemail.com: domain of po-hsu.lin@canonical.com designates 185.125.188.123 as permitted sender) smtp.mailfrom=po-hsu.lin@canonical.com; dmarc=pass (policy=none) header.from=canonical.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7EA4D20019DF X-Stat-Signature: 6tp4ejqpw6jac9kubq1um4x77gm17dc6 X-HE-Tag: 1629704097-628080 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: There are several test cases in the vm directory are still using exit 0 when they need to be skipped. Use kselftest framework skip code instead so it can help us to distinguish the return status. Criterion to filter out what should be fixed in vm directory: grep -r "exit 0" -B1 | grep -i skip This change might cause some false-positives if people are running these test scripts directly and only checking their return codes, which will change from 0 to 4. However I think the impact should be small as most of our scripts here are already using this skip code. And there will be no such issue if running them with the kselftest framework. Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/vm/charge_reserved_hugetlb.sh | 5 ++++- tools/testing/selftests/vm/hugetlb_reparenting_test.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vm/charge_reserved_hugetlb.sh b/tools/testing/selftests/vm/charge_reserved_hugetlb.sh index 18d3368..fe8fcfb 100644 --- a/tools/testing/selftests/vm/charge_reserved_hugetlb.sh +++ b/tools/testing/selftests/vm/charge_reserved_hugetlb.sh @@ -1,11 +1,14 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + set -e if [[ $(id -u) -ne 0 ]]; then echo "This test must be run as root. Skipping..." - exit 0 + exit $ksft_skip fi fault_limit_file=limit_in_bytes diff --git a/tools/testing/selftests/vm/hugetlb_reparenting_test.sh b/tools/testing/selftests/vm/hugetlb_reparenting_test.sh index d11d1fe..4a9a3af 100644 --- a/tools/testing/selftests/vm/hugetlb_reparenting_test.sh +++ b/tools/testing/selftests/vm/hugetlb_reparenting_test.sh @@ -1,11 +1,14 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + set -e if [[ $(id -u) -ne 0 ]]; then echo "This test must be run as root. Skipping..." - exit 0 + exit $ksft_skip fi usage_file=usage_in_bytes