Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1641477pxb; Mon, 23 Aug 2021 00:37:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhAoTrsS3UNpfdyFyWlebTJQ6eNne6C+Z67GTl+p8NRin2qId5H4gr1JXVT/ZI+gIhvtjS X-Received: by 2002:a17:907:2989:: with SMTP id eu9mr33795523ejc.89.1629704221880; Mon, 23 Aug 2021 00:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629704221; cv=none; d=google.com; s=arc-20160816; b=q9DgcLyvLPJrMb4ALNrd63wyEN+n8a8v2y/imsIHvcvfVmhruHsxFHdyauF3aTv5xS ofz51cCIORTs6bdbSJxweCaqwAH4uaDXwQ68ISJTasEUpoRMienzQZLX+hSeYJTKazbP qmfm6rzdAlGFMEkl6iIyBtAqyVrBDnn+BCFaZ6hcoKLxKAlsZu64HXYcDlgpN2kOmPZh iM9VnxPrxDZNijyjulzg/HrVo6hfRjvrtOzx4hl1fMsZ3zRfGS086D+CpW2oFkV1kYLM DMs6lXrIHxUsgTXhKbH5Ya0tPhPQ1f4HCUeP21Un4f8uj3TJaofmcBgMBq27zz2g6SV7 wPhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vpW+MmQwHzNcx/1v6dYqOYxABjq4D11QeSkA/JaBIuk=; b=biGlEnbNqRw3qg6Oy5APukvEuj5X1jE/5t+q3R4j2xQwuGrJVWpDJAKr9fTJfB9Ri/ OK6Yd5B5sHoH9O8pnXcB5J1mNLoYBSoOtc13XtkT/KG2aIiEL8l9s4uDPXiKGXXvBvCJ UQok8eV4a02XwUkL3nFM5e5QuGyvpQktgU65RFWusFn4LLGRlvnsTL0i9Vka370mPXaW 2jKiY23/erMgig/3LJxwAfkAO2geMcJqo2x2sZy49OvqefMVTL+IMcgNDaoPR6RloOgv bQHw8VnNTiOvnXNwKVO51Fm1r1Q8/Qc9bJ3pJ71xpGlOb0ERZi/hv+5zskPy1xAxir0W uPWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=A+Oc9jNH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq7si14319332ejc.589.2021.08.23.00.36.38; Mon, 23 Aug 2021 00:37:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=A+Oc9jNH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234993AbhHWHfg (ORCPT + 99 others); Mon, 23 Aug 2021 03:35:36 -0400 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]:47412 "EHLO smtp-relay-internal-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234940AbhHWHff (ORCPT ); Mon, 23 Aug 2021 03:35:35 -0400 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (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 528344075E 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-pj1-f70.google.com with SMTP id c2-20020a17090a558200b001873dcb7f09so1286402pji.7 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=Lv8F22pXsu7UXm5zmy5fwNOfnCSsF9p/BgNJ2H9ZHnHqyaR5IKgY8KJoHvfKkVvjHy HF0IW8/dBrzXUt+CIrPwOBS+F+SvpW+ai9sUvZNr6JpC5qvOapsT2Ux/dCnzWxcZ1TxU yTkjscidw5vzA5t/XSDCUMQvM7Q/rFiC7QY3Ixzdy31kdN6+qQMqKFliZwtypJs4nWIf pwwNXGhtKqO+kJVvNzG4RNDPafVXP42XFKqW7WrBRTCIYKiwiUxOOM56ocIA06Lw7VgS DkA0/8Fph31OhO9Wbb1YOM6UBLG9qmytDblyF1aoaqOMmZWDaIB+tadG3MJwRXRDEEWL R+YA== X-Gm-Message-State: AOAM533eJqjMCvkYltasOMEkmkMTjue0sE72flVQMmjiHbhn4XpUK6st ZfSegRHqfI/QGUVbNscn1lJmHA8Kdhxujhicb26qbM/EyOgCBu2QgLl+a8chCAzSerHqx8ez1Gi ueXlBIMX7+x9E/yI+IGVLAa8MxLKxEcNLGQ9pfMWo X-Received: by 2002:a63:5d03:: with SMTP id r3mr30374605pgb.144.1629704090871; Mon, 23 Aug 2021 00:34:50 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.7.4