[chrony-dev] [PATCH] test: check if RTC is RTC_UIE_ON capable

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


The test might run on different platforms.
If the platform happens to have a RTC that does exist but unable to
have RTC_UIE_ON set the test will fall into an infinite hang.

Exampls of bad clocks are:
- ppc64el: rtc-generic
- arm64: rtc-efi

To avoid that check the capability via `hwclock` before the test and skip
if it is unable to use it.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx>
---
 test/system/101-rtc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/system/101-rtc b/test/system/101-rtc
index fa9a70d..cbffd1c 100755
--- a/test/system/101-rtc
+++ b/test/system/101-rtc
@@ -4,6 +4,7 @@
 
 check_chronyd_features RTC || test_skip "RTC support disabled"
 [ -c "/dev/rtc" ] || test_skip "missing /dev/rtc"
+hwclock -r --test  | grep -q '^ioctl.*RTC_UIE_ON.*Invalid argument$' && test_skip "RTC not RTC_UIE_ON capable"
 
 test_start "real-time clock"
 
-- 
2.24.0


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/