All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] rtc: Display errno where applicable
@ 2016-09-21 11:18 Richard Palethorpe
  2016-09-22 11:30 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Palethorpe @ 2016-09-21 11:18 UTC (permalink / raw)
  To: ltp

RTC_ALM_READ currently fails on ppc64 4.4.21 (SLES) and the errno is not
displayed. There are not many values it is able to take, but displaying it
could still reduce the time taken to understand the problem. By the same
logic TERRNO has been added to all other test_resm calls where applicable.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 testcases/kernel/device-drivers/rtc/rtc01.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/testcases/kernel/device-drivers/rtc/rtc01.c b/testcases/kernel/device-drivers/rtc/rtc01.c
index acfcd34..7f9bc07 100644
--- a/testcases/kernel/device-drivers/rtc/rtc01.c
+++ b/testcases/kernel/device-drivers/rtc/rtc01.c
@@ -69,7 +69,7 @@ void read_alarm_test(void)
 	/*Read RTC Time */
 	ret = ioctl(rtc_fd, RTC_RD_TIME, &rtc_tm);
 	if (ret == -1) {
-		tst_resm(TFAIL, "RTC_RD_TIME ioctl failed");
+		tst_resm(TFAIL | TERRNO, "RTC_RD_TIME ioctl failed");
 		return;
 	}
 
@@ -101,14 +101,14 @@ void read_alarm_test(void)
 		if (errno == EINVAL)
 			tst_resm(TCONF | TERRNO, "RTC_ALM_SET not supported");
 		else
-			tst_resm(TFAIL | TERRNO , "RTC_ALM_SET ioctl failed");
+			tst_resm(TFAIL | TERRNO, "RTC_ALM_SET ioctl failed");
 		return;
 	}
 
 	/*Read current alarm time */
 	ret = ioctl(rtc_fd, RTC_ALM_READ, &rtc_tm);
 	if (ret == -1) {
-		tst_resm(TFAIL, "RTC_ALM_READ ioctl failed");
+		tst_resm(TFAIL | TERRNO, "RTC_ALM_READ ioctl failed");
 		return;
 	}
 
@@ -117,7 +117,7 @@ void read_alarm_test(void)
 	/* Enable alarm interrupts */
 	ret = ioctl(rtc_fd, RTC_AIE_ON, 0);
 	if (ret == -1) {
-		tst_resm(TINFO, "RTC_AIE_ON ioctl failed");
+		tst_resm(TINFO | TERRNO, "RTC_AIE_ON ioctl failed");
 		return;
 	}
 
@@ -132,12 +132,12 @@ void read_alarm_test(void)
 	ret = select(rtc_fd + 1, &rfds, NULL, NULL, &tv);	/*wait for alarm */
 
 	if (ret == -1) {
-		tst_resm(TFAIL, "select failed");
+		tst_resm(TFAIL | TERRNO, "select failed");
 		return;
 	} else if (ret) {
 		ret = read(rtc_fd, &data, sizeof(unsigned long));
 		if (ret == -1) {
-			tst_resm(TFAIL, "read failed");
+			tst_resm(TFAIL | TERRNO, "read failed");
 			return;
 		}
 		tst_resm(TINFO, "Alarm rang.");
@@ -149,7 +149,7 @@ void read_alarm_test(void)
 	/* Disable alarm interrupts */
 	ret = ioctl(rtc_fd, RTC_AIE_OFF, 0);
 	if (ret == -1) {
-		tst_resm(TFAIL, "RTC_AIE_OFF ioctl failed");
+		tst_resm(TFAIL | TERRNO, "RTC_AIE_OFF ioctl failed");
 		return;
 	}
 	tst_resm(TPASS, "RTC ALARM TEST Passed");
@@ -189,12 +189,12 @@ void update_interrupts_test(void)
 
 		ret = select(rtc_fd + 1, &rfds, NULL, NULL, &tv);
 		if (ret == -1) {
-			tst_resm(TFAIL, "select failed");
+			tst_resm(TFAIL | TERRNO, "select failed");
 			return;
 		} else if (ret) {
 			ret = read(rtc_fd, &data, sizeof(unsigned long));
 			if (ret == -1) {
-				tst_resm(TFAIL, "read failed");
+				tst_resm(TFAIL | TERRNO, "read failed");
 				return;
 			}
 			tst_resm(TINFO, "Update interrupt %d", i);
@@ -208,7 +208,7 @@ void update_interrupts_test(void)
 	/* Turn off update interrupts */
 	ret = ioctl(rtc_fd, RTC_UIE_OFF, 0);
 	if (ret == -1) {
-		tst_resm(TFAIL, "RTC_UIE_OFF ioctl failed");
+		tst_resm(TFAIL | TERRNO, "RTC_UIE_OFF ioctl failed");
 		return;
 	}
 	tst_resm(TPASS, "RTC UPDATE INTERRUPTS TEST Passed");
-- 
2.10.0

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

* [LTP] [PATCH] rtc: Display errno where applicable
  2016-09-21 11:18 [LTP] [PATCH] rtc: Display errno where applicable Richard Palethorpe
@ 2016-09-22 11:30 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2016-09-22 11:30 UTC (permalink / raw)
  To: ltp

Hi!
Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

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

end of thread, other threads:[~2016-09-22 11:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 11:18 [LTP] [PATCH] rtc: Display errno where applicable Richard Palethorpe
2016-09-22 11:30 ` Cyril Hrubis

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.