public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/getpriority01: exclude default priority check for PRIO_USER.
@ 2016-11-17  6:02 Guangwen Feng
  2016-11-22  8:56 ` Cyril Hrubis
  0 siblings, 1 reply; 7+ messages in thread
From: Guangwen Feng @ 2016-11-17  6:02 UTC (permalink / raw)
  To: ltp

The current user priority is various when testing,
we should not check it as default value.

Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
---
 testcases/kernel/syscalls/getpriority/getpriority01.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/syscalls/getpriority/getpriority01.c b/testcases/kernel/syscalls/getpriority/getpriority01.c
index cca88a7..9a9a364 100644
--- a/testcases/kernel/syscalls/getpriority/getpriority01.c
+++ b/testcases/kernel/syscalls/getpriority/getpriority01.c
@@ -19,7 +19,8 @@
 
 /*
  * Verify that getpriority(2) succeeds get the scheduling priority of
- * the current process, process group or user.
+ * the current process, process group or user, the default priority
+ * of process and process group is 0.
  */
 
 #include <errno.h>
@@ -29,10 +30,11 @@
 
 static struct tcase {
 	int which;
+	int defprio_strict;
 } tcases[] = {
-	{PRIO_PROCESS},
-	{PRIO_PGRP},
-	{PRIO_USER}
+	{PRIO_PROCESS, 1},
+	{PRIO_PGRP, 1},
+	{PRIO_USER, 0}
 };
 
 static void verify_getpriority(unsigned int n)
@@ -41,7 +43,7 @@ static void verify_getpriority(unsigned int n)
 
 	TEST(getpriority(tc->which, 0));
 
-	if (TEST_RETURN != 0 || TEST_ERRNO != 0) {
+	if ((tc->defprio_strict && TEST_RETURN != 0) || TEST_ERRNO != 0) {
 		tst_res(TFAIL | TTERRNO, "getpriority(%d, 0) returned %ld",
 			tc->which, TEST_RETURN);
 		return;
-- 
1.8.4.2




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-24  7:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-17  6:02 [LTP] [PATCH] syscalls/getpriority01: exclude default priority check for PRIO_USER Guangwen Feng
2016-11-22  8:56 ` Cyril Hrubis
2016-11-22  9:34   ` Guangwen Feng
2016-11-22  9:37     ` Cyril Hrubis
2016-11-23  6:26       ` Guangwen Feng
2016-11-23 15:04         ` Cyril Hrubis
2016-11-24  7:02           ` Guangwen Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox