[LTP] [PATCH v2 4/4] sched_get_priority_max01: Add missing policies

Petr Vorel pvorel@suse.cz
Tue Jan 25 15:40:43 CET 2022


+ improve doc wording and update copyright.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
changes v1->v2:
* code is the same, only copyright and doc updated

 .../sched_get_priority_max01.c                      | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c b/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c
index f6fe1add9c..b9a58a46a4 100644
--- a/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c
+++ b/testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c
@@ -2,6 +2,7 @@
 /*
  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
  * Copyright (c) 2021 sujiaxun <sujiaxun@uniontech.com>
+ * Copyright (c) Linux Test Project, 2009-2022
  */
 
 /*\
@@ -10,9 +11,11 @@
  * Basic test for the sched_get_priority_max(2) system call.
  *
  * Obtain different maximum priority for different schedulling policies and
- * compare them with expected value.
+ * compare them with the expected value.
  */
 
+#define _GNU_SOURCE
+
 #include <sched.h>
 #include "tst_test.h"
 #include "lapi/syscalls.h"
@@ -24,14 +27,16 @@ static struct test_case {
 	int policy;
 	int retval;
 } tcases[] = {
-	{POLICY_DESC(SCHED_OTHER), 0},
+	{POLICY_DESC(SCHED_BATCH), 0},
+	{POLICY_DESC(SCHED_DEADLINE), 0},
 	{POLICY_DESC(SCHED_FIFO), 99},
-	{POLICY_DESC(SCHED_RR), 99}
+	{POLICY_DESC(SCHED_IDLE), 0},
+	{POLICY_DESC(SCHED_OTHER), 0},
+	{POLICY_DESC(SCHED_RR), 99},
 };
 
 static void run_test(unsigned int nr)
 {
-
 	struct test_case *tc = &tcases[nr];
 
 	TST_EXP_VAL(tst_syscall(__NR_sched_get_priority_max, tc->policy),
-- 
2.34.1



More information about the ltp mailing list