From 39ccf1dd6fa64b525e017b629b9a83409d294c7e Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Fri, 24 Sep 2021 14:07:06 -0500 Subject: [PATCH] unix: skip TestIoctlGetRTCWkAlrm if unsupported Some RTC devices do not support wakeup alarms and will return EINVAL in such cases. The generic powerpc rtc driver is one such case. Fixes golang/go#48554 Change-Id: I46f6da7902586a7fcaa9a367801d9fead288e264 Reviewed-on: https://go-review.googlesource.com/c/sys/+/352090 Run-TryBot: Paul Murphy TryBot-Result: Go Bot Trust: David Chase Reviewed-by: Tobias Klauser Reviewed-by: Ian Lance Taylor --- unix/syscall_linux_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unix/syscall_linux_test.go b/unix/syscall_linux_test.go index dd0fa6a8..f5d39660 100644 --- a/unix/syscall_linux_test.go +++ b/unix/syscall_linux_test.go @@ -117,6 +117,12 @@ func TestIoctlGetRTCWkAlrm(t *testing.T) { defer f.Close() v, err := unix.IoctlGetRTCWkAlrm(int(f.Fd())) + + // Not all RTC drivers support wakeup alarms, and will return EINVAL in such cases. + if err == unix.EINVAL { + t.Skip("RTC_WKALM_RD ioctl not supported on this rtc, skipping test") + } + if err != nil { t.Fatalf("failed to perform ioctl: %v", err) }