Received: by 10.192.165.148 with SMTP id m20csp681929imm; Fri, 4 May 2018 18:16:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZosGAY94RzJtUNFUDXxcl1kq/mDarBvYcDLErGKKD7Df96HTh2NHI3zvrC3o3LJ/ekELLRZ X-Received: by 2002:a17:902:968d:: with SMTP id n13-v6mr28947926plp.168.1525482983931; Fri, 04 May 2018 18:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525482983; cv=none; d=google.com; s=arc-20160816; b=KoQH1Cs8WTUDxIvDuRWcbmAMV81D4hWt9QYssIgGH3hHoEFJtpY7Zm6VKmq+xmGUYU /HtNed67Lraf260AkdSfPCr5sgHFQ5MLCy2B8st/fkekHPxt7A4yUFHMxATlfxLLcTbm qbaOLnVJBIcGAf0tJAPr+ZIIg/zogaptUkI2yrduOyznHmvuq5auYf5cnSmLYLvt6qyv 55cLii8b75+tBS2bBGsUZYdmhEZFd1FytOw35CH5ri1GZjZ+UsCCY58FZfdppetxG0d4 82h7/bK1aLFumqR4gO7/iXbJw0+OmX3dLDHqgo9t8fva4hbmti3sPUcAntTNAJdG/d2d 1orQ== 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=KmnvqY33exX+4ExZXdwa3bNXXqrrrKfw+pQniwPpWwE=; b=dMSLOPPHF8S+ZWM1dby41KS81p028e/DETJtAXHdoH59Srtos3kgN1PU9k+Kh1Kqs+ 1cARYffSdyiz5htzRN6lu/hC1/PSEEFspz3RgACKPGrxwgnWYkpwd9pgCZ/Ry1Zijcp/ sB9eQaTL5UIslQOM2ZOfFC0Xc+8QDKi7nJo2Y87ATVrd5iuJWJnA6TO8NTsUlqwfO6gL BnOv5GfsZC/tZDe4wwCMtRB7qGI83MMW1L/7IOs5TRzTU3z7wOGi4UpQmA1Gll2NeM/k 9vP60mFv9RQZDfuMZY4w/D7eNYCn8zgzXAJq2oHyVy82B/ZnjZ70nIJXRPss5K0H9rQY D4yg== 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 q14-v6si16173187pls.286.2018.05.04.18.16.10; Fri, 04 May 2018 18:16:23 -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 S1752076AbeEEBPj (ORCPT + 99 others); Fri, 4 May 2018 21:15:39 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:50456 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbeEEBPh (ORCPT ); Fri, 4 May 2018 21:15:37 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 301F021235; Sat, 5 May 2018 01:15:37 +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 HT322uYr661y; Sat, 5 May 2018 01:15:37 +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 3C1E421020; Sat, 5 May 2018 01:15:27 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org, bamv2005@gmail.com, brgl@bgdev.pl Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 10/24] selftests: gpio: return Kselftest Skip code for skipped tests Date: Fri, 4 May 2018 19:13:14 -0600 Message-Id: <20180505011328.32078-10-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 gpio test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative 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/gpio/gpio-mockup.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/gpio/gpio-mockup.sh b/tools/testing/selftests/gpio/gpio-mockup.sh index 183fb932edbd..7f35b9880485 100755 --- a/tools/testing/selftests/gpio/gpio-mockup.sh +++ b/tools/testing/selftests/gpio/gpio-mockup.sh @@ -2,10 +2,11 @@ # SPDX-License-Identifier: GPL-2.0 #exit status -#1: run as non-root user +#1: Internal error #2: sysfs/debugfs not mount #3: insert module fail when gpio-mockup is a module. -#4: other reason. +#4: Skip test including run as non-root user. +#5: other reason. SYSFS= GPIO_SYSFS= @@ -15,6 +16,9 @@ GPIO_DEBUGFS= dev_type= module= +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + usage() { echo "Usage:" @@ -34,7 +38,7 @@ prerequisite() msg="skip all tests:" if [ $UID != 0 ]; then echo $msg must be run as root >&2 - exit 1 + exit $ksft_skip fi SYSFS=`mount -t sysfs | head -1 | awk '{ print $3 }'` if [ ! -d "$SYSFS" ]; then @@ -73,7 +77,7 @@ remove_module() die() { remove_module - exit 4 + exit 5 } test_chips() -- 2.14.1