On 2019-12-10T15:52+0100, Christian Ehrhardt wrote:
>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"
^^^^^^^^^^^^^^^^
Careful here, hwclock is internationalized.
Thanks for the warning, the ioctl and the flag RTC_UIE_ON should be always the same.
The errno might be changing, but we could just drop that from the check maybe and be safe?
> test_start "real-time clock"