All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
@ 2014-02-21  7:51 Francesco RUNDO
  2014-02-21  8:02 ` Wanlong Gao
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco RUNDO @ 2014-02-21  7:51 UTC (permalink / raw)
  To: ltp-list

Changed exit code from TFAIL to TCONF  in case of unsupported
syscall. The "madvise" syscall needs kernel support as well as
fs support as -for specific advice- it requires specific filesystem
operations such as fallocate().
So, if kernel support is missed or fs doesn't provide specific
operation needed for such "advice" scenario of that syscall, the right
exit code (according to LTP defs) is not TFAIL as it is not a failure
but it is TCONF as the syscall is unsupported.

Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
---
 testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/madvise/madvise03.c b/testcases/kernel/syscalls/madvise/madvise03.c
index b0c17e8..23dd9a6 100644
--- a/testcases/kernel/syscalls/madvise/madvise03.c
+++ b/testcases/kernel/syscalls/madvise/madvise03.c
@@ -160,10 +160,19 @@ static void cleanup(void)
 static void check_and_print(char *advice)
 {
 	if (TEST_RETURN == -1) {
-		tst_resm(TFAIL,
-			 "madvise test for %s failed with "
-			 "return = %ld, errno = %d : %s",
-			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
+		if (TEST_ERRNO != ENOTSUP) {
+			tst_resm(TFAIL,
+				 "madvise test for %s failed with "
+				 "return = %ld, errno = %d : %s",
+				 advice, TEST_RETURN, TEST_ERRNO,
+				 strerror(TEST_ERRNO));
+		} else {
+			tst_resm(TCONF,
+				"madvise test for %s unsupported "
+				"return = %ld, errno = %d : %s",
+				advice, TEST_RETURN, TEST_ERRNO,
+				strerror(TEST_ERRNO));
+		}
 	} else if (STD_FUNCTIONAL_TEST) {
 		tst_resm(TPASS, "madvise test for %s PASSED", advice);
 	}
-- 
1.7.7.6


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2014-02-25 17:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21  7:51 [LTP] [PATCH] madvise/madvise03.c: Changed test exit code Francesco RUNDO
2014-02-21  8:02 ` Wanlong Gao
2014-02-21  8:38   ` Francesco RUNDO
2014-02-21  8:39     ` Wanlong Gao
2014-02-21  9:08     ` Jan Stancek
2014-02-21  9:21       ` Francesco RUNDO
2014-02-21 10:06         ` Jan Stancek
2014-02-21 10:25           ` Francesco RUNDO
2014-02-21 11:01             ` Jan Stancek
2014-02-21 11:09               ` Jan Stancek
2014-02-21 12:28                 ` Francesco RUNDO
2014-02-21 12:37                   ` Jan Stancek
2014-02-21 12:42                     ` Francesco RUNDO
2014-02-25 17:59                       ` chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.