From: "tan.shaopeng@fujitsu.com" <tan.shaopeng@fujitsu.com>
To: 'Reinette Chatre' <reinette.chatre@intel.com>,
Fenghua Yu <fenghua.yu@intel.com>, Shuah Khan <shuah@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>
Subject: RE: [PATCH 2/3] selftests/resctrl: Return KSFT_SKIP(4) if resctrl filessystem is not supported or resctrl is not run as root
Date: Wed, 1 Dec 2021 02:36:51 +0000 [thread overview]
Message-ID: <TYAPR01MB63303777416D1D3C0EF066278B689@TYAPR01MB6330.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <6b9ed425-cadb-15df-4c4f-eb1dc0b814dd@intel.com>
Hi Reinette
> (subject line and commit message: filessystem -> file system)
Thanks.
> On 11/10/2021 1:33 AM, Shaopeng Tan wrote:
> > From: "Tan, Shaopeng" <tan.shaopeng@jp.fujitsu.com>
> >
> > To unify the return code of resctrl_tests with the return code of
> > selftest set, return KSFT_SKIP (4) if resctrl filessystem is not
> > supported or resctrl is not run as root.
>
> Could you please elaborate how changing ksft_exit_fail_msg() to
> ksft_exit_skip() accomplishes the goal of unifying the return code?
> What is wrong with using ksft_exit_fail_msg()?
In selftest framwork,
if a test need root privileges, but it is run as user privileges,
the test result will counted as a SKIP item, instead of a FAIL item.
For example,
(1)tools/testing/selftests/mqueue/mq_open_tests.c
267 if (getuid() != 0)
268 ksft_exit_skip("Not running as root, but almost all tests "
269 "require root in order to modify\nsystem settings. "
270 "Exiting.\n");
(2)tools/testing/selftests/bpf/test_kmod.sh
5 ksft_skip=4
6
7 msg="skip all tests:"
8 if [ "$(id -u)" != "0" ]; then
9 echo $msg please run this as root >&2
10 exit $ksft_skip
11 fi
Regards,
Shaopeng Tan
next prev parent reply other threads:[~2021-12-01 2:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 9:33 [PATCH 0/3] selftests/resctrl: Add resctrl_tests into kselftest set Shaopeng Tan
2021-11-10 9:33 ` [PATCH 1/3] selftests/resctrl: Make resctrl_tests run using kselftest framework Shaopeng Tan
2021-11-29 19:27 ` Reinette Chatre
2021-12-01 2:36 ` tan.shaopeng
2021-12-02 0:18 ` Reinette Chatre
2021-12-03 7:21 ` tan.shaopeng
2021-12-03 23:08 ` Reinette Chatre
2021-12-06 6:57 ` tan.shaopeng
2021-12-06 15:23 ` Reinette Chatre
2021-11-10 9:33 ` [PATCH 2/3] selftests/resctrl: Return KSFT_SKIP(4) if resctrl filessystem is not supported or resctrl is not run as root Shaopeng Tan
2021-11-29 19:27 ` Reinette Chatre
2021-12-01 2:36 ` tan.shaopeng [this message]
2021-12-02 0:39 ` Reinette Chatre
2021-11-10 9:33 ` [PATCH 3/3] selftests/resctrl: Kill the child process created by fork() when the SIGTERM signal comes Shaopeng Tan
2021-11-24 11:00 ` [PATCH 0/3] selftests/resctrl: Add resctrl_tests into kselftest set tan.shaopeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=TYAPR01MB63303777416D1D3C0EF066278B689@TYAPR01MB6330.jpnprd01.prod.outlook.com \
--to=tan.shaopeng@fujitsu.com \
--cc=fenghua.yu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).