feat(time-sync): the BMC's NTP servers through TimeSyncMixin #5

Merged
christianmanivong merged 2 commits from feature/time-sync-2367 into main 2026-11-11 14:51:43 +00:00
2 Commits
Author SHA1 Message Date
Christian Manivong 679ff20f94 fix(tests): import the test helpers by their own name
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m1s
driver / test (3.13) (pull_request) Successful in 53s
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 54s
CI / driver (pull_request) Successful in 2m25s
driver / publish (pull_request) Skipped
textfsm 2.1.1 (2026-11-10, through napalm) installs a top-level package
"tests" into site-packages. It shadows this repo's tests directory, which
is no package, so "from tests.conftest import ..." found textfsm's and
test_bmc_driver.py and test_x10_redfish.py failed to import: every test
run on CI fails since that release, main included.

The helpers are imported as conftest and test_ipmi, the way
test_driver.py already does; pytest puts tests/ on the path for them.
2026-11-11 15:43:27 +01:00
Christian Manivong daa7dc9726 feat(time-sync): the BMC's NTP servers through TimeSyncMixin
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Failing after 58s
driver / test (3.13) (pull_request) Failing after 55s
driver / lowest (pull_request) Failing after 30s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Failing after 2m29s
driver / publish (pull_request) Skipped
netOrk keeps one list of NTP servers per site and aligns a device that
differs (NetOrk/netork#2360). A BMC takes part through Redfish's
ManagerNetworkProtocol: NTP.NTPServers is read, and written with a
PATCH that carries the resource's @odata.etag as If-Match, so a change
made on the BMC in between is refused instead of overwritten.

BMCs give the array a fixed length and show the unused slots as empty
strings (three on an iDRAC 9, two on an iLO 5). Such an array is filled
up with its empty value, and more servers than slots are refused before
anything is written. Servers of a disabled NTP are not in use: they read
as none, and the write turns NTP on. Servers the BMC already uses are
not written again, so a poll that aligns it every time does not churn.
get_ntp_servers() follows the same rule.

A BMC runs on UTC or an offset (DateTimeLocalOffset), not a zone, so
time_sync_writes is {"ntp_servers"} and the zone is read only where the
manager names an IANA zone (TimeZoneName). A BMC whose Redfish has no
NTP block (the Supermicro X10's v1_0_0) raises rather than claiming it
has no servers. The bmc driver has it over Redfish only; ipmi has none.

Needs napalm-device-types 4.35.0.

Refs NetOrk/netork#2367
2026-11-11 15:20:35 +01:00