Received: by 10.192.165.148 with SMTP id m20csp681170imm; Fri, 4 May 2018 18:15:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpAr/5P09BLBuxC5odYi22ztWRCCUiHVypKeA80Bl+vfKF9i7RthQtRvSzgS5+7Yu4mgbWA X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr29655547plz.336.1525482906568; Fri, 04 May 2018 18:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525482906; cv=none; d=google.com; s=arc-20160816; b=rv4o6/BWhLNyNjpLpVOpD25A5bCxxQmKpYXlEYl8H0NqbQxzrdSscLQT/gRXsHcCIC 1y6nF1R9ts3gOaEO3PIQq+8IJ1nF/2FDVFakDcIh+2gL3iynCuxvsNu/KuyWlo9ZZ05T 3Ty8X83HSlwNGtUUu0JFRHe4EC9iXCYefCYK00GMRtZMr9u4yji93QjXH1W5b4B/sH/g j59uPbxawX/oripbwK0OG7gcW5gICd/ginhFDwXJidDH8PWeIEBAIvc4S6GMZCdHoUjA SRS4klS9/kuQ5aWjUEmX4V7YNcrpEXtaZrJTRHmPkQmPuiFE2mkD3uj72nOrq1pQX/BF ItrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=1Irzs8SBaedHCOuHA+wDyzRjMGiTp5wR/ELVKjDM9U4=; b=GviXIiB8GyEb6dQ9Mexn4uS8EB2CN281St7pssZZv5zF1AjPET/R3jYBi2JnLKNUt+ ftYs68Vk1loWXp6uvm6noBSJvs//f7o/xx5ukORPkN3E3x55SC9wi/6KekW3Bx9ELgb+ Azn/W7kL19Pl9gThDRIUMfCCXhpSWb+PLBmZo04+riK5n/XexiM5Sw0kVaWNfF9qQAZI bXPd31Tq5sTq4HxxtaD3oe21KY1xYVzaoVcBrl2ak/Z2hLSQwlUGOiXYYGGs50oczeXX zSlDdvr6n52eaO2mhSFC6q3xs51cb67tnmpv1ScHZNsJjVnk+frCvsu00VEtewWlnh3W IVow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si17114070pfj.294.2018.05.04.18.14.52; Fri, 04 May 2018 18:15:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751983AbeEEBOa (ORCPT + 99 others); Fri, 4 May 2018 21:14:30 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:50380 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbeEEBO2 (ORCPT ); Fri, 4 May 2018 21:14:28 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 1C5F2210A9; Sat, 5 May 2018 01:14:27 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5fm9CA0FGBdH; Sat, 5 May 2018 01:14:27 +0000 (UTC) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id B871221020; Sat, 5 May 2018 01:14:22 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/24] selftests: efivarfs: return Kselftest Skip code for skipped tests Date: Fri, 4 May 2018 19:13:09 -0600 Message-Id: <20180505011328.32078-5-shuah@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180505011328.32078-1-shuah@kernel.org> References: <20180505011328.32078-1-shuah@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When efivarfs test is skipped because of unmet dependencies and/or unsupported configuration, it returns 0 which is treated as a pass by the Kselftest framework. This leads to false positive result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/efivarfs/efivarfs.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index c6d5790575ae..a47029a799d2 100755 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh @@ -4,18 +4,21 @@ efivarfs_mount=/sys/firmware/efi/efivars test_guid=210be57c-9849-4fc7-a635-e6382d1aec27 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + check_prereqs() { local msg="skip all tests:" if [ $UID != 0 ]; then echo $msg must be run as root >&2 - exit 0 + exit $ksft_skip fi if ! grep -q "^\S\+ $efivarfs_mount efivarfs" /proc/mounts; then echo $msg efivarfs is not mounted on $efivarfs_mount >&2 - exit 0 + exit $ksft_skip fi } -- 2.14.1