Skip to content

Commit

Permalink
updated testcase to use freebsd utility
Browse files Browse the repository at this point in the history
  • Loading branch information
r-dailey committed Mar 19, 2024
1 parent 5a8b8ed commit e2877f7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions microsoft/testsuites/core/timesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
UnsupportedCpuArchitectureException,
create_timer,
)
from lisa.operating_system import CpuArchitecture, Redhat, Suse
from lisa.operating_system import BSD, CpuArchitecture, Redhat, Suse
from lisa.tools import Cat, Chrony, Dmesg, Hwclock, Lscpu, Ntp, Ntpstat, Service
from lisa.tools.date import Date
from lisa.tools.lscpu import CpuType
Expand Down Expand Up @@ -325,12 +325,16 @@ def verify_timesync_ntp(self, node: Node) -> None:
"which is provided in the chrony package."
)
ntp = node.tools[Ntp]
hwclock = node.tools[Hwclock]
if not isinstance(node.os, BSD):
hwclock = node.tools[Hwclock]
service = node.tools[Service]
# 1. Stop systemd-timesyncd if this service exists.
service.stop_service("systemd-timesyncd")
# 2. Set rtc clock to system time.
hwclock.set_rtc_clock_to_system_time()
if not isinstance(node.os, BSD):
hwclock.set_rtc_clock_to_system_time()
else:
node.execute("adjkerntz -i")
# 3. Restart Ntp service.
ntp.restart()
# 4. Check and set server setting in config file.
Expand Down

0 comments on commit e2877f7

Please sign in to comment.