Received: by 10.192.165.148 with SMTP id m20csp3813026imm; Mon, 7 May 2018 20:30:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZovayRVNx4dAYEEcZBHTxyeKgdnhInVcdrttdC2Xid1MWl0Dc6TzS+cta0INvtW57+xblHJ X-Received: by 2002:a17:902:7109:: with SMTP id a9-v6mr40206620pll.271.1525750259736; Mon, 07 May 2018 20:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525750259; cv=none; d=google.com; s=arc-20160816; b=I2iluhTRYJtVk0J7JsNCIzg6sidXUWtpJvATWAfU86h8M8Z36sJXlERR28cwCdxL7R oA2WRjc93Oi8tPaWTF69WYXvzq2L4lGLATGdafxEVyF+LOuxDpOPEnXiiSObEXqxVrW0 m+rJRTlQ4cSS9obwuq6D8tRzm/Wv+SG06XogB5ubLgYeUsXPbExJjbTbp8lhbra+TSDI 7wk81XVVD0YMH43rryO7OZVPgYViQx1947FB2um7o0VxvJwo6kopjb417J2CkYnBs5PR iniAA1lFGxhcJDLj9n+4mUnyN2DOnusB2CTs4EOf0i0nYpTKIUB/Pepjcq4r/ZCa3DKL QZ5A== 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 :dkim-signature:arc-authentication-results; bh=/yEtx3Q1KDaodRXFhEFPMAds+JlVI3mq7xIuGL2mmmw=; b=Y4f1nv1LP7m7vNnHMNGQRF6VSfzuv87CdQ8TMgF+r1JUiRMBOEXWV/PlsCMYi24+F0 Nu2tlA9i+JgmYaWEM6ePCGpyvRz+aN1GzE0ZikcRVdRwifOp4xTN9OvGuxlz/3STDnLL 7i8npaycjKRMyQ7H57Jjg4rZkK+Q0dVwh8j5Ui5F6oGuITeh6IS0++lg7pHVm0rFlV1x XkdVmX36vf2zHLomm4W2BbYr8wvPT8jCcuK55MlqOgCshRuRHZ10ecdfvtxGgbAYmkF8 do4ObcXTh/+2Womh3J3fJLw9F/mAyTtYprlxp5Q9Hxy22u5lOZYeKw9hRAkYvzHmq8YM MXCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NSnTTD/d; 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=pass (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 a5-v6si12746369pgc.537.2018.05.07.20.30.45; Mon, 07 May 2018 20:30:59 -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; dkim=pass header.i=@kernel.org header.s=default header.b=NSnTTD/d; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754168AbeEHD3O (ORCPT + 99 others); Mon, 7 May 2018 23:29:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:60810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753824AbeEHD3M (ORCPT ); Mon, 7 May 2018 23:29:12 -0400 Received: from devbox (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 33BE020C48; Tue, 8 May 2018 03:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1525750152; bh=MHImHtg3DlnLzTwb94NvGV2miCY8RU+iykyx63RFMyk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NSnTTD/dqmNeA6dYk4st5D0uBvcjB07DD/VSYHOzGM+vw0iBSqr+bqPvoiqgfeZCK U3jKewdmU57h9aJcddeXPZkKNHS6FrWhGcXieYhZ6JZLix0bMqIa+YtyoLxFmO+0nZ BFsKHmi+Lnva1T5nG4QqsrDB/Vnh41WPLWbKXR0c= Date: Tue, 8 May 2018 12:29:09 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: "Shuah Khan (Samsung OSG)" , 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: <20180508122909.e64612790be5a62cefbf1476@kernel.org> In-Reply-To: <20180507111721.7f8a6b35@gandalf.local.home> References: <20180505011328.32078-1-shuah@kernel.org> <20180505011328.32078-9-shuah@kernel.org> <20180507111721.7f8a6b35@gandalf.local.home> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-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 Mon, 7 May 2018 11:17:21 -0400 Steven Rostedt wrote: > 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. Oh, I'm happy with updating my script to follow the kselftest framework spec, since that is the standard. Shuah, is there any document which describe the return code for kselftest framework? (And I think it should report some FAIL/PASS counts to kselftest However, this patch seems not working as you expected. If kselftest framework would like to get the SKIP code from ftrace script, you need to update TOTAL_RESULT before leave. > If anything, we probably need to have a way to override the ksft_skip > via a command line argument. > > Masami? Agreed. Maybe we can pass the option via an environment variable. Thanks, > > -- 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 > > > -- Masami Hiramatsu