Received: by 10.192.165.148 with SMTP id m20csp274764imm; Wed, 9 May 2018 12:28:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp/AEKc7g84SVNYPpY6sVu6FW+NDHPLxDkiMwqNXXRC/cgu7Bb/24ni4Z8ReUA4x4cLM6hQ X-Received: by 2002:a17:902:369:: with SMTP id 96-v6mr25031705pld.64.1525894102992; Wed, 09 May 2018 12:28:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525894102; cv=none; d=google.com; s=arc-20160816; b=eQicgQ/BmxnFibPEaIDXKfsnnvkd40+5EJE/+OyROLydBsgRsvGRgSidwaaA3Mn36m buanmJw3Ub2E4F/c1LM9xYAbepWOx0iqyFinoKQn/WM/PB9FysmiXgxeqgPs6X4yRNbK RO2O0QQUcwd8d/cGuwpVcM6y/z6JwS/35dhjpWDhve7ifkDb71tXOuc1XyUUxWpEr8li A1+j3Hso/MOjWxogF1srxO129AOuMQYExG2IscZ649+cgn9MiW7Q8hKv6aNOKpjtaLDq c/MSkiMa03yT6nVMA67i20+dOOg82EGzdxO6HurDgU2YxhILSQN5k43R2gbxsUzYkiFv VeTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=VJ7KV2CdoslBDXTp8Qrad6DvAUuqM1fNfMz8s/s9kiw=; b=DMJHzSsIT52H+N/3bppuBGznuSN6LfZijfFLePT7qhWfNouAHVktc/NDwxXd++t3Pb 5EjwcvesPsxFGJkhJFJo9Xz7WVGZKb4P37QiFCO2vSbfp4z8+awRKJxjKIU2Nd3/ami4 3Z0Fl0KDl9WvRiRHwszm5duh83pRkIVan3kYm7KedBMhGJerqaKAG+q7ezZUzBPuDTqI XHopcYQrW8rHghSalbPAmNOinYyaku7pYGTFE58q9uZdwYE6R3I69IU67MMLDehlEeSL PyMh1OrsPKttxYY/JNdpcQLJQxnAUYKqaKXrNpECfzOUufcBWVZGjg6AQ/g8fi6BNtZn jUKQ== 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 h14si27171108pfj.178.2018.05.09.12.28.08; Wed, 09 May 2018 12:28:22 -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 S965396AbeEIT15 (ORCPT + 99 others); Wed, 9 May 2018 15:27:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:60717 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964972AbeEIT1z (ORCPT ); Wed, 9 May 2018 15:27:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 46E4DADCD; Wed, 9 May 2018 19:27:54 +0000 (UTC) Date: Wed, 9 May 2018 19:27:54 +0000 From: "Luis R. Rodriguez" To: "Shuah Khan (Samsung OSG)" Cc: 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, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/24] selftests: firmware: return Kselftest Skip code for skipped tests Message-ID: <20180509192754.GS27853@wotan.suse.de> References: <20180505011328.32078-1-shuah@kernel.org> <20180505011328.32078-8-shuah@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180505011328.32078-8-shuah@kernel.org> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 04, 2018 at 07:13:12PM -0600, Shuah Khan (Samsung OSG) wrote: > 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) Reviewed-by: Luis R. Rodriguez Luis > --- > 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 > > -- Do not panic