Received: by 10.192.165.148 with SMTP id m20csp3201833imm; Mon, 7 May 2018 08:17:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpaziNwSLaAwqe6Q+JsjaG2e7reKNoIdAQB17e9IoBYyYUKBkg26K2PkQC27Wlsj/9WqdQ8 X-Received: by 2002:a9d:34f1:: with SMTP id t46-v6mr25426241otd.396.1525706277366; Mon, 07 May 2018 08:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525706277; cv=none; d=google.com; s=arc-20160816; b=feUtp86AS0xJKaMTqFVrk5fY9BFq/flpqphoJEsKfiouOMO0Y/bBBATxR4iSKshEQy L0ZXLGCglDjnzo4jJlpB/qJXZe7uTK988w4YYjYa/3TdMlffcgYyLXgpH09nLaWfBOSV f0nzOxOdRAa1dG1AChYYQ8pS8HBkmixN/dVOVCK4HnY5d7zC1BMAbb/LrwWNP56ZDrCb bvfCx/hA5mkzpA/2LUjOPOkJpAzpJp9B9vjpPXTG3PVO3EdW23Wx0q2Qo16utKMV50pA o86pNPMbiVRJSJhIzdQVigGisWlZMX1Y2kbSVxshKp9N6kWYqJB+0S0K0jviBWKDZsXC 2koQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=wA/lNxYcSTxg06iQz1aZUiip7zsc2e09ID2ayumi3OE=; b=ap/5CgokSu7OlSns7FQa3l//0G7HM6dTH0s5nzGJH2iUedJwnzItJFSwcZXfRNo4FR oAQO5g4pjruMVYX5PAcDk5fmjld9XO4N9usUk/ZWHeoCiYdPOttG+/ayhslfrRcDtX8f e5LrK3yLXCryWPpZMBz+f3EvdbIUwpKPC/Kf7jjilPqObXXIHXo+XdmtmDW1uNUhjDMH HpZNhtFi+4nGKPL03/nff/yZC/MbhDoVbyvqVBaQfb7VrFvtZQoGiUqTeqt0xsC7ST2D dsK4hx+Yk25WhDkueNfJyC/AXEkhvN+UfP40IQBHPohGDd90ufdBv5ZCpSykke/cHPfi myVA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g196-v6si7926092oib.300.2018.05.07.08.17.43; Mon, 07 May 2018 08:17:57 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbeEGPR1 (ORCPT + 99 others); Mon, 7 May 2018 11:17:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:50250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752036AbeEGPRY (ORCPT ); Mon, 7 May 2018 11:17:24 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 51EC621741; Mon, 7 May 2018 15:17:23 +0000 (UTC) Date: Mon, 7 May 2018 11:17:21 -0400 From: Steven Rostedt To: "Shuah Khan (Samsung OSG)" Cc: mhiramat@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/24] selftests: ftrace: return Kselftest Skip code for skipped tests Message-ID: <20180507111721.7f8a6b35@gandalf.local.home> In-Reply-To: <20180505011328.32078-9-shuah@kernel.org> References: <20180505011328.32078-1-shuah@kernel.org> <20180505011328.32078-9-shuah@kernel.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 May 2018 19:13:13 -0600 "Shuah Khan (Samsung OSG)" wrote: > When ftrace 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. > I'm fine with this change, but I believe Masami and perhaps others have scripts that expect zero return. If anything, we probably need to have a way to override the ksft_skip via a command line argument. Masami? -- Steve > Signed-off-by: Shuah Khan (Samsung OSG) > --- > tools/testing/selftests/ftrace/ftracetest | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest > index f9a9d424c980..b731c8cdcffb 100755 > --- a/tools/testing/selftests/ftrace/ftracetest > +++ b/tools/testing/selftests/ftrace/ftracetest > @@ -23,6 +23,9 @@ echo " If is -, all logs output in console only" > exit $1 > } > > +# Kselftest framework requirement - SKIP code is 4. > +ksft_skip=4 > + > errexit() { # message > echo "Error: $1" 1>&2 > exit 1 > @@ -30,7 +33,8 @@ errexit() { # message > > # Ensuring user privilege > if [ `id -u` -ne 0 ]; then > - errexit "this must be run by root user" > + echo "Skipping: test must be run by root user" > + exit $ksft_skip > fi > > # Utilities > @@ -249,7 +253,7 @@ trap 'SIG_RESULT=$UNTESTED' $SIG_UNTESTED > SIG_UNSUPPORTED=$((SIG_BASE + UNSUPPORTED)) > exit_unsupported () { > kill -s $SIG_UNSUPPORTED $SIG_PID > - exit 0 > + exit $ksft_skip > } > trap 'SIG_RESULT=$UNSUPPORTED' $SIG_UNSUPPORTED >