test(time-sync): follow napalm-device-types 4.36.0, which keeps DHCP's servers

napalm-device-types 4.36.0 (released after main's last CI run) changed
PosixTimeSyncMixin: get_time_sync() reports DHCP-provided servers apart
(dhcp_ntp_servers), and configure_time_sync() no longer comments out the
DHCP client's chrony sourcedir; it gives back one that 4.35.0 took out
(NetOrk/netork#2380). CI installs the newest release, so five time-sync
tests failed on every branch.

The tests now expect that behaviour, read DHCP's servers apart, and check
that a node 4.35.0 aligned gets its DHCP sourcedir back. The floor moves
to 4.36.0, so the lowest-versions job tests the same behaviour; README,
CHANGELOG and the module docstring say what a write leaves alone.
This commit is contained in:
Christian Manivong committed 2026-11-13 08:55:37 +01:00
1 parent a67e8492ee
commit 83d1ef780e
5 files changed
+59 -18

No files matched your search

+8 -7
View File
@@ -9,13 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Time sync on both drivers (NetOrk/netork#2365), through napalm-device-types'
`TimeSyncMixin` (4.35.0); both write the servers and the zone. Neither API keeps time
`TimeSyncMixin` (4.36.0); both write the servers and the zone. Neither API keeps time
servers -- both products run chrony on Debian -- so `get_time_sync()` reads chrony's
sources, whether it is synchronised and the zone (`timedatectl`) in one round trip over
the driver's SSH session (`PosixTimeSyncMixin`), and the zone from `GET
/nodes/{node}/time` only where the host names none. `configure_time_sync()` writes the
servers to `/etc/chrony/sources.d/netork.sources` with every other source commented out
(Debian's vendor pool, the DHCP `sourcedir`) and reloads or restarts chrony; the zone
sources, the ones DHCP gave apart (`dhcp_ntp_servers`), whether it is synchronised and
the zone (`timedatectl`) in one round trip over the driver's SSH session
(`PosixTimeSyncMixin`), and the zone from `GET /nodes/{node}/time` only where the host
names none. `configure_time_sync()` writes the servers to
`/etc/chrony/sources.d/netork.sources` with every other configured source commented out
(Debian's vendor pool; the DHCP `sourcedir` stays) and reloads or restarts chrony; the zone
goes through `PUT /nodes/{node}/time`, Proxmox's own call, so `/etc/timezone` and the
web UI follow `/etc/localtime`. The token needs `Sys.Modify` for it (PVE on
`/nodes/{node}`, PBS on `/system/time`). Only the node of the connection is read and
@@ -45,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
in its own daemons; `get_clusters()` and `get_backup_jobs()` keep them.
### Changed
- Requires napalm-device-types 4.35.0.
- Requires napalm-device-types 4.36.0.
### Fixed
- `set_hostname()` writes the new `/etc/hosts` to a `mktemp` file beside it