aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/timers
diff options
context:
space:
mode:
authorLukáš Doktor <ldoktor@redhat.com>2017-08-15 10:46:00 +0200
committerShuah Khan <shuahkh@osg.samsung.com>2017-08-16 17:48:19 -0600
commit4db26f9e642bdf55ba54c559839e8ef9495b83c7 (patch)
tree5f4c613effb8f9934e16352fe0e3e018c9fdc445 /tools/testing/selftests/timers
parentselftests/cpu-hotplug: Skip test when there is only one online cpu (diff)
downloadlinux-dev-4db26f9e642bdf55ba54c559839e8ef9495b83c7.tar.xz
linux-dev-4db26f9e642bdf55ba54c559839e8ef9495b83c7.zip
rtc: rtctest: Improve support detection
The rtc-generic and opal-rtc are failing to run this test as they do not support all the features. Let's treat the error returns and skip to the following test. Theoretically the test_DATE should be also adjusted, but as it's enabled on demand I think it makes sense to fail in such case. Signed-off-by: Lukáš Doktor <ldoktor@redhat.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/timers')
-rw-r--r--tools/testing/selftests/timers/rtctest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/timers/rtctest.c b/tools/testing/selftests/timers/rtctest.c
index f61170f7b024..411eff625e66 100644
--- a/tools/testing/selftests/timers/rtctest.c
+++ b/tools/testing/selftests/timers/rtctest.c
@@ -221,6 +221,11 @@ test_READ:
/* Read the current alarm settings */
retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
if (retval == -1) {
+ if (errno == EINVAL) {
+ fprintf(stderr,
+ "\n...EINVAL reading current alarm setting.\n");
+ goto test_PIE;
+ }
perror("RTC_ALM_READ ioctl");
exit(errno);
}
@@ -231,7 +236,7 @@ test_READ:
/* Enable alarm interrupts */
retval = ioctl(fd, RTC_AIE_ON, 0);
if (retval == -1) {
- if (errno == EINVAL) {
+ if (errno == EINVAL || errno == EIO) {
fprintf(stderr,
"\n...Alarm IRQs not supported.\n");
goto test_PIE;