lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1410820442-8774-8-git-send-email-shuahkh@osg.samsung.com>
Date:	Mon, 15 Sep 2014 16:34:02 -0600
From:	Shuah Khan <shuahkh@....samsung.com>
To:	akpm@...ux-foundation.org, gregkh@...uxfoundation.org,
	colin.king@...onical.com, dbueso@...e.de, ebiederm@...ssion.com,
	serge.hallyn@...ntu.com, thierry@...ux.vnet.ibm.com,
	felipensp@...il.com
Cc:	Shuah Khan <shuahkh@....samsung.com>, linux-api@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 7/7] selftests/timers: change timers test to use kselftest exit codes

Change timers test to use kselftest exit codes in kselftest.h
to report test results.

Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
---
 tools/testing/selftests/timers/posix_timers.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c
index 41bd855..7ae2c3b 100644
--- a/tools/testing/selftests/timers/posix_timers.c
+++ b/tools/testing/selftests/timers/posix_timers.c
@@ -15,6 +15,8 @@
 #include <time.h>
 #include <pthread.h>
 
+#include "../kselftest.h"
+
 #define DELAY 2
 #define USECS_PER_SEC 1000000
 
@@ -188,22 +190,23 @@ static int check_timer_create(int which)
 
 int main(int argc, char **argv)
 {
-	int err;
+	int err = EXIT_FAIL;
 
-	printf("Testing posix timers. False negative may happen on CPU execution \n");
+	printf("Testing posix timers.\n"
+		"False negative may happen on CPU execution\n");
 	printf("based timers if other threads run on the CPU...\n");
 
 	if (check_itimer(ITIMER_VIRTUAL) < 0)
-		return -1;
+		return err;
 
 	if (check_itimer(ITIMER_PROF) < 0)
-		return -1;
+		return err;
 
 	if (check_itimer(ITIMER_REAL) < 0)
-		return -1;
+		return err;
 
 	if (check_timer_create(CLOCK_THREAD_CPUTIME_ID) < 0)
-		return -1;
+		return err;
 
 	/*
 	 * It's unfortunately hard to reliably test a timer expiration
@@ -215,7 +218,7 @@ int main(int argc, char **argv)
 	 * find a better solution.
 	 */
 	if (check_timer_create(CLOCK_PROCESS_CPUTIME_ID) < 0)
-		return -1;
+		return err;
 
-	return 0;
+	return EXIT_PASS;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ