Received: by 10.192.165.148 with SMTP id m20csp681677imm; Fri, 4 May 2018 18:15:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrVRuXSBnPT8xQbPISJrBsrSatEaCrInMDHYqnWjiiVTVP6wFNxXEWE9+E3tq8VkoJtCAtr X-Received: by 2002:a17:902:7795:: with SMTP id o21-v6mr9774592pll.36.1525482956208; Fri, 04 May 2018 18:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525482956; cv=none; d=google.com; s=arc-20160816; b=LzQCjfwwXdq0vW8dAokR8yRFJXL66zaxQWLDoHcSK9luQLHCTy1MRUIBUlNQjw1vzn vznSPaDw2/kG/+H8GlcqIik+UgdJKDZIsOYA6IpOe7/OiQ5lccC090/QtRfs3Z5nbYSo gLWhSbrsInDfHu9jLEuQV2lAmoyZvCKdTwvZPaFJlcxsXriIp26jxqGfbtLhkyva12gB 0+RwR+Oz2+vj0cgZkjeqH6h1hUSJ8d6ZFgj7duhXor3+ZhRdKgBfo2lyuCJ4hcEUbzDR 0pQ8HGxIpRhRgJ8bLSpV8NCCBS4/XMuVBG87cnoHMIGcM1tD6aSk2Bvir7rgB2nhK0rr d/Lw== 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=jXmS3U3AbFhq6VYamznmqm+GmuE+DTvY0VpmteHP/4o=; b=xHvAAj/oUc99whzjRbxgoQjJUwx8PcmzhO9NStIzewPPzZn+H76slOkw/YA79vHp+e AQuSQe12SawUAKPp96Z/11P5ES5x1gT5+bVOFd+8cKtzH9oAS0xyn7zPORFDDiYYGkkr OLhshIQffZPE0onbcdkyPR0f6PZ10hBiUa+vZFqm/BmaomZ4I5Pg44SRj9Z3wo1oE9ER nsAzcspIG1+0Z2Lwgy2cnB6h0/dNWzh+V+lEGVy+7kwIFhbyc4Odun7UoIzMnzbT5V5g +3G6K0z2/v+63xU40UA6PNZ+NwwID1KxDICCNd6BDhfLA9NsAtFPn4IEQdAlK9o15p8e PBPA== 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 64si16930732pfl.309.2018.05.04.18.15.41; Fri, 04 May 2018 18:15:56 -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 S1752040AbeEEBPL (ORCPT + 99 others); Fri, 4 May 2018 21:15:11 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:50426 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbeEEBPK (ORCPT ); Fri, 4 May 2018 21:15:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 85EAB21235; Sat, 5 May 2018 01:15:09 +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 UXGCxPlAwYAK; Sat, 5 May 2018 01:15:09 +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 C3FDF21020; Sat, 5 May 2018 01:14:54 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org, gregkh@linuxfoundation.org, mcgrof@kernel.org, keescook@chromium.org, tglx@linutronix.de, sumit.semwal@linaro.org, amit.pundir@linaro.org, ben.hutchings@codethink.co.uk Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/24] selftests: firmware: return Kselftest Skip code for skipped tests Date: Fri, 4 May 2018 19:13:12 -0600 Message-Id: <20180505011328.32078-8-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 firmware test(s) get 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/firmware/fw_fallback.sh | 4 ++-- tools/testing/selftests/firmware/fw_filesystem.sh | 4 +++- tools/testing/selftests/firmware/fw_lib.sh | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh index 8e2e34a2ca69..70d18be46af5 100755 --- a/tools/testing/selftests/firmware/fw_fallback.sh +++ b/tools/testing/selftests/firmware/fw_fallback.sh @@ -74,7 +74,7 @@ load_fw_custom() { if [ ! -e "$DIR"/trigger_custom_fallback ]; then echo "$0: custom fallback trigger not present, ignoring test" >&2 - return 1 + exit $ksft_skip fi local name="$1" @@ -107,7 +107,7 @@ load_fw_custom_cancel() { if [ ! -e "$DIR"/trigger_custom_fallback ]; then echo "$0: canceling custom fallback trigger not present, ignoring test" >&2 - return 1 + exit $ksft_skip fi local name="$1" diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh index 6452d2129cd9..a4320c4b44dc 100755 --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh @@ -30,6 +30,7 @@ fi if [ ! -e "$DIR"/trigger_async_request ]; then echo "$0: empty filename: async trigger not present, ignoring test" >&2 + exit $ksft_skip else if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then echo "$0: empty filename should not succeed (async)" >&2 @@ -69,6 +70,7 @@ fi # Try the asynchronous version too if [ ! -e "$DIR"/trigger_async_request ]; then echo "$0: firmware loading: async trigger not present, ignoring test" >&2 + exit $ksft_skip else if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then echo "$0: could not trigger async request" >&2 @@ -89,7 +91,7 @@ test_config_present() { if [ ! -f $DIR/reset ]; then echo "Configuration triggers not present, ignoring test" - exit 0 + exit $ksft_skip fi } diff --git a/tools/testing/selftests/firmware/fw_lib.sh b/tools/testing/selftests/firmware/fw_lib.sh index 962d7f4ac627..6c5f1b2ffb74 100755 --- a/tools/testing/selftests/firmware/fw_lib.sh +++ b/tools/testing/selftests/firmware/fw_lib.sh @@ -9,11 +9,14 @@ DIR=/sys/devices/virtual/misc/test_firmware PROC_CONFIG="/proc/config.gz" TEST_DIR=$(dirname $0) +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + print_reqs_exit() { echo "You must have the following enabled in your kernel:" >&2 cat $TEST_DIR/config >&2 - exit 1 + exit $ksft_skip } test_modprobe() @@ -88,7 +91,7 @@ verify_reqs() if [ "$TEST_REQS_FW_SYSFS_FALLBACK" = "yes" ]; then if [ ! "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then echo "usermode helper disabled so ignoring test" - exit 0 + exit $ksft_skip fi fi } -- 2.14.1