From: Jan Kiszka <[email protected]>

With dovetail, clock_settime affects the Linux wall clock as well. When
systemd-timesyncd is running, the posix-clock test will fail because its
check of clock settings will immediately be overwritten by timesyncd
again. So stop that service if present and running and restart it after
the test.

Signed-off-by: Jan Kiszka <[email protected]>
---
 testsuite/xeno-test/xeno-test.in | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/testsuite/xeno-test/xeno-test.in b/testsuite/xeno-test/xeno-test.in
index 505adfd75..95bf59606 100644
--- a/testsuite/xeno-test/xeno-test.in
+++ b/testsuite/xeno-test/xeno-test.in
@@ -82,7 +82,18 @@ echo 0 > /proc/xenomai/latency || :
 
 testdir=@testdir@
 
+timesyncd_running=false
+if which systemctl > /dev/null && systemctl is-active --quiet 
systemd-timesyncd; then
+    timesyncd_running=true
+    systemctl stop systemd-timesyncd
+fi
+
 $testdir/smokey --run $run_on_vm $keep_going random_alloc_rounds=64 
pattern_check_rounds=64
+
+if $timesyncd_running; then
+    systemctl start systemd-timesyncd
+fi
+
 $testdir/clocktest -D -T 30 -C CLOCK_HOST_REALTIME || $testdir/clocktest -T 30
 $testdir/switchtest -T 30
 
-- 
2.26.2

Reply via email to