* [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests
@ 2026-09-16 21:31 Wolfram Sang
2026-09-16 21:31 ` [PATCH 1/3] selftest: rtc: rtctest: don't mention skipping twice Wolfram Sang
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Wolfram Sang @ 2026-09-16 21:31 UTC (permalink / raw)
To: linux-rtc; +Cc: Wolfram Sang, Alexandre Belloni, linux-kselftest, Shuah Khan
Here are some fixes for issues I found in 'rtctest' while checking RTC
drivers. Details are in the patch descriptions. Patches 1+2 have been
tested on HW. Patch 3 has not been tested, just follows the pattern of
patch 2, but may need more discussion in general. Please read there.
Looking forward to comments!
Wolfram Sang (3):
selftest: rtc: rtctest: don't mention skipping twice
selftest: rtc: rtctest: make missing UIEs really skip
RFC selftest: rtc: rtctest: skip properly if setting alarm fails
tools/testing/selftests/rtc/rtctest.c | 49 ++++++++++++---------------
1 file changed, 21 insertions(+), 28 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 1/3] selftest: rtc: rtctest: don't mention skipping twice 2026-09-16 21:31 [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang @ 2026-09-16 21:31 ` Wolfram Sang 2026-09-16 21:38 ` sashiko-bot 2026-09-16 21:31 ` [PATCH 2/3] selftest: rtc: rtctest: make missing UIEs really skip Wolfram Sang ` (2 subsequent siblings) 3 siblings, 1 reply; 9+ messages in thread From: Wolfram Sang @ 2026-09-16 21:31 UTC (permalink / raw) To: linux-rtc; +Cc: Wolfram Sang, Alexandre Belloni, Shuah Khan, linux-kselftest The framework already annotates that we are skipping something. No need to do in the tests themselves again. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- tools/testing/selftests/rtc/rtctest.c | 31 +++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c index 8047d9879039..077cdc2c6f87 100644 --- a/tools/testing/selftests/rtc/rtctest.c +++ b/tools/testing/selftests/rtc/rtctest.c @@ -49,7 +49,7 @@ TEST_F(rtc, date_read) { struct rtc_time rtc_tm; if (self->fd == -1 && errno == ENOENT) - SKIP(return, "Skipping test since %s does not exist", rtc_file); + SKIP(return, "%s does not exist", rtc_file); ASSERT_NE(-1, self->fd); /* Read the RTC time/date */ @@ -118,7 +118,7 @@ TEST_F_TIMEOUT(rtc, date_read_loop, READ_LOOP_DURATION_SEC + 2) { time_t start_rtc_read, prev_rtc_read; if (self->fd == -1 && errno == ENOENT) - SKIP(return, "Skipping test since %s does not exist", rtc_file); + SKIP(return, "%s does not exist", rtc_file); ASSERT_NE(-1, self->fd); TH_LOG("Continuously reading RTC time for %ds (with %dms breaks after every read).", @@ -156,7 +156,7 @@ TEST_F_TIMEOUT(rtc, uie_read, NUM_UIE + 2) { unsigned long data; if (self->fd == -1 && errno == ENOENT) - SKIP(return, "Skipping test since %s does not exist", rtc_file); + SKIP(return, "%s does not exist", rtc_file); ASSERT_NE(-1, self->fd); /* Turn on update interrupts */ @@ -185,7 +185,7 @@ TEST_F(rtc, uie_select) { unsigned long data; if (self->fd == -1 && errno == ENOENT) - SKIP(return, "Skipping test since %s does not exist", rtc_file); + SKIP(return, "%s does not exist", rtc_file); ASSERT_NE(-1, self->fd); /* Turn on update interrupts */ @@ -229,14 +229,14 @@ TEST_F(rtc, alarm_alm_set) { enum rtc_alarm_state alarm_state = RTC_ALARM_UNKNOWN; if (self->fd == -1 && errno == ENOENT) - SKIP(return, "Skipping test since %s does not exist", rtc_file); + SKIP(return, "%s does not exist", rtc_file); ASSERT_NE(-1, self->fd); alarm_state = get_rtc_alarm_state(self->fd, 1); if (alarm_state == RTC_ALARM_DISABLED) - SKIP(return, "Skipping test since alarms are not supported."); + SKIP(return, "alarms are not supported."); if (alarm_state == RTC_ALARM_RES_MINUTE) - SKIP(return, "Skipping test since alarms has only minute granularity."); + SKIP(return, "alarms has only minute granularity."); rc = ioctl(self->fd, RTC_RD_TIME, &tm); ASSERT_NE(-1, rc); @@ -299,14 +299,14 @@ TEST_F(rtc, alarm_wkalm_set) { enum rtc_alarm_state alarm_state = RTC_ALARM_UNKNOWN; if (self->fd == -1 && errno == ENOENT) - SKIP(return, "Skipping test since %s does not exist", rtc_file); + SKIP(return, "%s does not exist", rtc_file); ASSERT_NE(-1, self->fd); alarm_state = get_rtc_alarm_state(self->fd, 1); if (alarm_state == RTC_ALARM_DISABLED) - SKIP(return, "Skipping test since alarms are not supported."); + SKIP(return, "alarms are not supported."); if (alarm_state == RTC_ALARM_RES_MINUTE) - SKIP(return, "Skipping test since alarms has only minute granularity."); + SKIP(return, "alarms has only minute granularity."); rc = ioctl(self->fd, RTC_RD_TIME, &alarm.time); ASSERT_NE(-1, rc); @@ -363,12 +363,12 @@ TEST_F_TIMEOUT(rtc, alarm_alm_set_minute, 65) { enum rtc_alarm_state alarm_state = RTC_ALARM_UNKNOWN; if (self->fd == -1 && errno == ENOENT) - SKIP(return, "Skipping test since %s does not exist", rtc_file); + SKIP(return, "%s does not exist", rtc_file); ASSERT_NE(-1, self->fd); alarm_state = get_rtc_alarm_state(self->fd, 0); if (alarm_state == RTC_ALARM_DISABLED) - SKIP(return, "Skipping test since alarms are not supported."); + SKIP(return, "alarms are not supported."); rc = ioctl(self->fd, RTC_RD_TIME, &tm); ASSERT_NE(-1, rc); @@ -431,12 +431,12 @@ TEST_F_TIMEOUT(rtc, alarm_wkalm_set_minute, 65) { enum rtc_alarm_state alarm_state = RTC_ALARM_UNKNOWN; if (self->fd == -1 && errno == ENOENT) - SKIP(return, "Skipping test since %s does not exist", rtc_file); + SKIP(return, "%s does not exist", rtc_file); ASSERT_NE(-1, self->fd); alarm_state = get_rtc_alarm_state(self->fd, 0); if (alarm_state == RTC_ALARM_DISABLED) - SKIP(return, "Skipping test since alarms are not supported."); + SKIP(return, "alarms are not supported."); rc = ioctl(self->fd, RTC_RD_TIME, &alarm.time); ASSERT_NE(-1, rc); @@ -502,8 +502,7 @@ int main(int argc, char **argv) if (access(rtc_file, R_OK) == 0) ret = test_harness_run(argc, argv); else - ksft_exit_skip("[SKIP]: Cannot access rtc file %s - Exiting\n", - rtc_file); + ksft_exit_skip("Cannot access rtc file %s - Exiting\n", rtc_file); return ret; } -- 2.53.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] selftest: rtc: rtctest: don't mention skipping twice 2026-09-16 21:31 ` [PATCH 1/3] selftest: rtc: rtctest: don't mention skipping twice Wolfram Sang @ 2026-09-16 21:38 ` sashiko-bot 0 siblings, 0 replies; 9+ messages in thread From: sashiko-bot @ 2026-09-16 21:38 UTC (permalink / raw) To: Wolfram Sang; +Cc: linux-rtc, Alexandre Belloni > The framework already annotates that we are skipping something. No need > to do in the tests themselves again. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review · https://sashiko.dev/#/patchset/20260916213108.9234-5-wsa+renesas@sang-engineering.com?part=1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] selftest: rtc: rtctest: make missing UIEs really skip 2026-09-16 21:31 [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang 2026-09-16 21:31 ` [PATCH 1/3] selftest: rtc: rtctest: don't mention skipping twice Wolfram Sang @ 2026-09-16 21:31 ` Wolfram Sang 2026-09-16 21:39 ` sashiko-bot 2026-09-16 21:31 ` [RFC PATCH 3/3] selftest: rtc: rtctest: skip properly if setting alarm fails Wolfram Sang 2026-10-08 19:48 ` [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang 3 siblings, 1 reply; 9+ messages in thread From: Wolfram Sang @ 2026-09-16 21:31 UTC (permalink / raw) To: linux-rtc; +Cc: Wolfram Sang, Alexandre Belloni, Shuah Khan, linux-kselftest Use the proper framework call to mark a test as skipped. Currently, the test is considered good, only the printout mentions the skip. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- tools/testing/selftests/rtc/rtctest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c index 077cdc2c6f87..962050a32985 100644 --- a/tools/testing/selftests/rtc/rtctest.c +++ b/tools/testing/selftests/rtc/rtctest.c @@ -163,8 +163,7 @@ TEST_F_TIMEOUT(rtc, uie_read, NUM_UIE + 2) { rc = ioctl(self->fd, RTC_UIE_ON, 0); if (rc == -1) { ASSERT_EQ(EINVAL, errno); - TH_LOG("skip update IRQs not supported."); - return; + SKIP(return, "update IRQs are not supported."); } for (i = 0; i < NUM_UIE; i++) { @@ -192,8 +191,7 @@ TEST_F(rtc, uie_select) { rc = ioctl(self->fd, RTC_UIE_ON, 0); if (rc == -1) { ASSERT_EQ(EINVAL, errno); - TH_LOG("skip update IRQs not supported."); - return; + SKIP(return, "update IRQs are not supported."); } for (i = 0; i < NUM_UIE; i++) { -- 2.53.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] selftest: rtc: rtctest: make missing UIEs really skip 2026-09-16 21:31 ` [PATCH 2/3] selftest: rtc: rtctest: make missing UIEs really skip Wolfram Sang @ 2026-09-16 21:39 ` sashiko-bot 0 siblings, 0 replies; 9+ messages in thread From: sashiko-bot @ 2026-09-16 21:39 UTC (permalink / raw) To: Wolfram Sang; +Cc: Alexandre Belloni, linux-rtc > Use the proper framework call to mark a test as skipped. Currently, the > test is considered good, only the printout mentions the skip. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review · https://sashiko.dev/#/patchset/20260916213108.9234-5-wsa+renesas@sang-engineering.com?part=2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC PATCH 3/3] selftest: rtc: rtctest: skip properly if setting alarm fails 2026-09-16 21:31 [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang 2026-09-16 21:31 ` [PATCH 1/3] selftest: rtc: rtctest: don't mention skipping twice Wolfram Sang 2026-09-16 21:31 ` [PATCH 2/3] selftest: rtc: rtctest: make missing UIEs really skip Wolfram Sang @ 2026-09-16 21:31 ` Wolfram Sang 2026-09-16 21:35 ` sashiko-bot 2026-10-08 19:48 ` [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang 3 siblings, 1 reply; 9+ messages in thread From: Wolfram Sang @ 2026-09-16 21:31 UTC (permalink / raw) To: linux-rtc; +Cc: Wolfram Sang, Alexandre Belloni, Shuah Khan, linux-kselftest Use the proper framework call to mark a test as skipped. Currently, the test is considered good, only the printout mentions the skip. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- Maybe I am reading the logic wrong. But, the SKIPs I add here are hit when setting an alarm fails. I wonder if this is really a SKIP and not an error? We have already checked above if alarms are supported using a designated check (and then skip), or? tools/testing/selftests/rtc/rtctest.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c index 962050a32985..46fbaef9fdeb 100644 --- a/tools/testing/selftests/rtc/rtctest.c +++ b/tools/testing/selftests/rtc/rtctest.c @@ -250,8 +250,7 @@ TEST_F(rtc, alarm_alm_set) { */ ASSERT_EQ(RTC_ALARM_UNKNOWN, alarm_state); ASSERT_EQ(EINVAL, errno); - TH_LOG("skip alarms are not supported."); - return; + SKIP(return, "alarms are not supported."); } rc = ioctl(self->fd, RTC_ALM_READ, &tm); @@ -322,8 +321,7 @@ TEST_F(rtc, alarm_wkalm_set) { */ ASSERT_EQ(RTC_ALARM_UNKNOWN, alarm_state); ASSERT_EQ(EINVAL, errno); - TH_LOG("skip alarms are not supported."); - return; + SKIP(return, "alarms are not supported."); } rc = ioctl(self->fd, RTC_WKALM_RD, &alarm); @@ -382,8 +380,7 @@ TEST_F_TIMEOUT(rtc, alarm_alm_set_minute, 65) { */ ASSERT_EQ(RTC_ALARM_UNKNOWN, alarm_state); ASSERT_EQ(EINVAL, errno); - TH_LOG("skip alarms are not supported."); - return; + SKIP(return, "alarms are not supported."); } rc = ioctl(self->fd, RTC_ALM_READ, &tm); @@ -452,8 +449,7 @@ TEST_F_TIMEOUT(rtc, alarm_wkalm_set_minute, 65) { */ ASSERT_EQ(RTC_ALARM_UNKNOWN, alarm_state); ASSERT_EQ(EINVAL, errno); - TH_LOG("skip alarms are not supported."); - return; + SKIP(return, "alarms are not supported."); } rc = ioctl(self->fd, RTC_WKALM_RD, &alarm); -- 2.53.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [RFC PATCH 3/3] selftest: rtc: rtctest: skip properly if setting alarm fails 2026-09-16 21:31 ` [RFC PATCH 3/3] selftest: rtc: rtctest: skip properly if setting alarm fails Wolfram Sang @ 2026-09-16 21:35 ` sashiko-bot 0 siblings, 0 replies; 9+ messages in thread From: sashiko-bot @ 2026-09-16 21:35 UTC (permalink / raw) To: Wolfram Sang; +Cc: Alexandre Belloni, linux-rtc > Use the proper framework call to mark a test as skipped. Currently, the > test is considered good, only the printout mentions the skip. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review · https://sashiko.dev/#/patchset/20260916213108.9234-5-wsa+renesas@sang-engineering.com?part=3 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests 2026-09-16 21:31 [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang ` (2 preceding siblings ...) 2026-09-16 21:31 ` [RFC PATCH 3/3] selftest: rtc: rtctest: skip properly if setting alarm fails Wolfram Sang @ 2026-10-08 19:48 ` Wolfram Sang 2026-10-08 22:19 ` Alexandre Belloni 3 siblings, 1 reply; 9+ messages in thread From: Wolfram Sang @ 2026-10-08 19:48 UTC (permalink / raw) To: linux-rtc; +Cc: Alexandre Belloni, linux-kselftest, Shuah Khan [-- Attachment #1: Type: text/plain, Size: 470 bytes --] On Wed, Sep 16, 2026 at 11:31:08PM +0200, Wolfram Sang wrote: > Here are some fixes for issues I found in 'rtctest' while checking RTC > drivers. Details are in the patch descriptions. Patches 1+2 have been > tested on HW. Patch 3 has not been tested, just follows the pattern of > patch 2, but may need more discussion in general. Please read there. > Looking forward to comments! I guess at least patches 1+2 are good to go? Who would pick them, Alexandre or Shuah? [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests 2026-10-08 19:48 ` [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang @ 2026-10-08 22:19 ` Alexandre Belloni 0 siblings, 0 replies; 9+ messages in thread From: Alexandre Belloni @ 2026-10-08 22:19 UTC (permalink / raw) To: Wolfram Sang; +Cc: linux-rtc, linux-kselftest, Shuah Khan On 08/10/2026 21:48:16+0200, Wolfram Sang wrote: > On Wed, Sep 16, 2026 at 11:31:08PM +0200, Wolfram Sang wrote: > > Here are some fixes for issues I found in 'rtctest' while checking RTC > > drivers. Details are in the patch descriptions. Patches 1+2 have been > > tested on HW. Patch 3 has not been tested, just follows the pattern of > > patch 2, but may need more discussion in general. Please read there. > > Looking forward to comments! > > I guess at least patches 1+2 are good to go? Who would pick them, > Alexandre or Shuah? > We discussed it at LPC, I'll take the patches. -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-10-08 22:19 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-16 21:31 [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang 2026-09-16 21:31 ` [PATCH 1/3] selftest: rtc: rtctest: don't mention skipping twice Wolfram Sang 2026-09-16 21:38 ` sashiko-bot 2026-09-16 21:31 ` [PATCH 2/3] selftest: rtc: rtctest: make missing UIEs really skip Wolfram Sang 2026-09-16 21:39 ` sashiko-bot 2026-09-16 21:31 ` [RFC PATCH 3/3] selftest: rtc: rtctest: skip properly if setting alarm fails Wolfram Sang 2026-09-16 21:35 ` sashiko-bot 2026-10-08 19:48 ` [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang 2026-10-08 22:19 ` Alexandre Belloni
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox