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.

Output generally looks like:
  ioctl(4, RTC_UIE_ON, 0): Invalid argument
But for internationalization only compare the left part of it.
In the good case this line won't show up at all.

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

diff --git a/test/system/101-rtc b/test/system/101-rtc
index fa9a70d..4ddca1e 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, 0):' && test_skip "RTC not 
RTC_UIE_ON capable"
 
 test_start "real-time clock"
 
-- 
2.24.0


-- 
To unsubscribe email chrony-dev-requ...@chrony.tuxfamily.org with "unsubscribe" 
in the subject.
For help email chrony-dev-requ...@chrony.tuxfamily.org with "help" in the 
subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.

Reply via email to