From: Shuah Khan <skhan@linuxfoundation.org>
To: Ivan Orlov <ivan.orlov0322@gmail.com>, shuah@kernel.org
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
himadrispandya@gmail.com,
linux-kernel-mentees@lists.linuxfoundation.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests: sched: Add more core schedule prctl calls
Date: Mon, 27 Mar 2023 13:55:01 -0600 [thread overview]
Message-ID: <af254c18-d55b-7343-32f8-d24ef0072e2c@linuxfoundation.org> (raw)
In-Reply-To: <20230322203724.4757-1-ivan.orlov0322@gmail.com>
Hi Ivan,
On 3/22/23 14:37, Ivan Orlov wrote:
> The core sched kselftest makes prctl calls only with correct
> parameters. This patch will extend this test with more core
> schedule prctl calls with wrong parameters to increase code
> coverage.
>
> Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Thank you for the patch.
> ---
> tools/testing/selftests/sched/cs_prctl_test.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/tools/testing/selftests/sched/cs_prctl_test.c b/tools/testing/selftests/sched/cs_prctl_test.c
> index 25e0d95d3713..df8e4629b3b5 100644
> --- a/tools/testing/selftests/sched/cs_prctl_test.c
> +++ b/tools/testing/selftests/sched/cs_prctl_test.c
> @@ -334,6 +334,14 @@ int main(int argc, char *argv[])
> validate(get_cs_cookie(pid) != 0);
> validate(get_cs_cookie(pid) == get_cs_cookie(procs[pidx].thr_tids[0]));
>
> + printf("\n## Try to pass wrong subcommand PR_SCHED_CORE_MAX = %d to prctl (shouldn't succeed)\n", PR_SCHED_CORE_MAX);
This message is unnecessary. validate() prints an error message.
> + validate(_prctl(PR_SCHED_CORE, PR_SCHED_CORE_MAX, 0, PIDTYPE_PGID, 0) < 0
> + && errno == EINVAL);
> +
> + printf("\n## Try to pass not-null uaddr with forbidden command (shouldn't succeed)\n");
Same here.
> + validate(_prctl(PR_SCHED_CORE, PR_SCHED_CORE_SHARE_TO, 0, PIDTYPE_PGID, 1) < 0
> + && errno == EINVAL);
> +
> if (errors) {
> printf("TESTS FAILED. errors: %d\n", errors);
> res = 10;
thanks,
-- Shuah
prev parent reply other threads:[~2023-03-27 19:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 20:37 [PATCH] selftests: sched: Add more core schedule prctl calls Ivan Orlov
2023-03-27 19:55 ` Shuah Khan [this message]
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=af254c18-d55b-7343-32f8-d24ef0072e2c@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=himadrispandya@gmail.com \
--cc=ivan.orlov0322@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--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