Received: by 10.192.165.148 with SMTP id m20csp680971imm; Fri, 4 May 2018 18:14:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpEWD+xTF9qxbWNebC/R2ZNQo9XqO5BckRmswFj3bOMkRGhLJ98g3UaLAfgFI8mXUz7hXix X-Received: by 2002:a17:902:6549:: with SMTP id d9-v6mr30043945pln.196.1525482891362; Fri, 04 May 2018 18:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525482891; cv=none; d=google.com; s=arc-20160816; b=p13uc5m9in/KQmDJH8IR5TMhOsCSDarheF4VKYmhJWecVDr/eDz+458q366MLygbLW W7O7Gg4bQ6+N5dirNpr0bC0Hl4k6uue0CTDAmTTm/l+5a6VGydp2zByNhg3aeZGYSIAz venyRuYZAQ/MtmbvbwPIWQPqssADF6anFkcQlXn4epv9ODcTmot651HkvYEAEb9Hj3FE O9bXMS5rD2Xo2q8O0zBPGC72QES+n5GicmbNKpuPsRiEvulb0g+kAwGz3pbjs5CgsTG6 XIJmcqogEbgyZCM0DyYUuAtOjjX2KjOSFNeg2xVQhlIbmV4YF0YfkCr6DfwHgYnuOc5n NWCw== 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=lwpBlipH6GOC41XHgKiuOCwpgdKVsC6wwhf5UVwexuU=; b=Hd0N8hHmG2Yb1aoXil8ovfPrwSl+VtuCtW9kb5e6NymfX7SsiH5XdsVAWhlACtBmk9 h5qRdfiDkJ8+Ng8X3HMSmxMig/C2XNUGEyFRxkYEW7Zs3H2xOmVTwmbpP5zFPDCAxV7k 358RzRJj+x3IKYzr5g6Ve/ZdVigxXapyGOP+gxCiwlSZCqGO3czD1gsEWP9vPawnTRp6 bY9NRaUD+lIvpzFrhyuvxGqP9Bx3A+GKD1+MP97c7X6AsOhebpBYuS8X/tEQjRl3mrMS UGLJgk8J31uG51oZFOkLA5Q8KPkZDUXS5HJQRzhH14H2ES6LO5D8JTTHYWCUjYVsjf52 kQtg== 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 m1si16521125pfe.79.2018.05.04.18.14.37; Fri, 04 May 2018 18:14:51 -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 S1751931AbeEEBOP (ORCPT + 99 others); Fri, 4 May 2018 21:14:15 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:50350 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbeEEBON (ORCPT ); Fri, 4 May 2018 21:14:13 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id F220621249; Sat, 5 May 2018 01:14:12 +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 ssieNmE6Us0Z; Sat, 5 May 2018 01:14:12 +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 D5C7621221; Sat, 5 May 2018 01:14:06 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org, lizhijian@cn.fujitsu.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/24] selftests: cpu-hotplug: return Kselftest Skip code for skipped tests Date: Fri, 4 May 2018 19:13:07 -0600 Message-Id: <20180505011328.32078-3-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 cpu-on-off-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/cpu-hotplug/cpu-on-off-test.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh index f3a8933c1275..bab13dd025a6 100755 --- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh +++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh @@ -2,6 +2,8 @@ # SPDX-License-Identifier: GPL-2.0 SYSFS= +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 prerequisite() { @@ -9,7 +11,7 @@ prerequisite() if [ $UID != 0 ]; then echo $msg must be run as root >&2 - exit 0 + exit $ksft_skip fi taskset -p 01 $$ @@ -18,12 +20,12 @@ prerequisite() if [ ! -d "$SYSFS" ]; then echo $msg sysfs is not mounted >&2 - exit 0 + exit $ksft_skip fi if ! ls $SYSFS/devices/system/cpu/cpu* > /dev/null 2>&1; then echo $msg cpu hotplug is not supported >&2 - exit 0 + exit $ksft_skip fi echo "CPU online/offline summary:" @@ -32,7 +34,7 @@ prerequisite() if [[ "$online_cpus" = "$online_max" ]]; then echo "$msg: since there is only one cpu: $online_cpus" - exit 0 + exit $ksft_skip fi echo -e "\t Cpus in online state: $online_cpus" @@ -237,12 +239,12 @@ prerequisite_extra() if [ ! -d "$DEBUGFS" ]; then echo $msg debugfs is not mounted >&2 - exit 0 + exit $ksft_skip fi if [ ! -d $NOTIFIER_ERR_INJECT_DIR ]; then echo $msg cpu-notifier-error-inject module is not available >&2 - exit 0 + exit $ksft_skip fi } -- 2.14.1