mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 07:37:34 -04:00
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 <murp@ibm.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: David Chase <drchase@google.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
1cf2251ac2
commit
39ccf1dd6f
@@ -117,6 +117,12 @@ func TestIoctlGetRTCWkAlrm(t *testing.T) {
|
|||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
v, err := unix.IoctlGetRTCWkAlrm(int(f.Fd()))
|
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 {
|
if err != nil {
|
||||||
t.Fatalf("failed to perform ioctl: %v", err)
|
t.Fatalf("failed to perform ioctl: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user