summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIvan Orlov <ivan.orlov0322@gmail.com>2023-03-28 00:18:55 +0400
committerShuah Khan <skhan@linuxfoundation.org>2023-03-28 10:27:07 -0600
commit14f4cc631afdb3234facf8542ea094ec529a4024 (patch)
tree30196d3afe5c7f5dd6c78775670f8c5ecdb4ce39 /tools
parentc83f320e55a49abd90629f42a72897afd579e0de (diff)
downloadlinux-stable-14f4cc631afdb3234facf8542ea094ec529a4024.tar.gz
linux-stable-14f4cc631afdb3234facf8542ea094ec529a4024.tar.bz2
linux-stable-14f4cc631afdb3234facf8542ea094ec529a4024.zip
selftests: sched: Add more core schedule prctl calls
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> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/sched/cs_prctl_test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/sched/cs_prctl_test.c b/tools/testing/selftests/sched/cs_prctl_test.c
index 25e0d95d3713..3e1619b6bf2d 100644
--- a/tools/testing/selftests/sched/cs_prctl_test.c
+++ b/tools/testing/selftests/sched/cs_prctl_test.c
@@ -334,6 +334,12 @@ 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]));
+ validate(_prctl(PR_SCHED_CORE, PR_SCHED_CORE_MAX, 0, PIDTYPE_PGID, 0) < 0
+ && errno == EINVAL);
+
+ 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;