time sync: record the DAL time settings, then implement TimeSyncMixin (NetOrk/netork#2366) #21

Open
opened 2026-11-11 14:27:10 +00:00 by christianmanivong · 0 comments
Owner

NetOrk/netork#2366 asks this driver to implement napalm-device-types' TimeSyncMixin (4.35.0): get_time_sync() read on every poll, configure_time_sync() written automatically when the gateway differs from its site.

It is not done yet, because nothing to build it on is known:

  • The driver drives Zyxel VMG residential gateways over the DAL web API, not a switch CLI. It reads no time settings today: get_ntp_servers() returns {} ("Not supported on Zyxel VMG").
  • The DAL object that holds them (likely oid=time, the TR-181 Device.Time. object with NTPServer1..NTPServer5 and Zyxel's own zone fields) has never been recorded from a gateway, and the README's "Tested against" table is empty. Building the read and, worse, an automatic write on guessed field names would put guessed values on customer gateways on every poll.

To do

  1. Record, read-only, the gateway's answer to GET cgi-bin/DAL?oid=time (and the web UI's "Time Setting" page) from a lab VMG, with the zone set to a named zone and to a plain offset, and with 1 and several NTP servers. Put the recordings into tests/fixtures/ (addresses replaced).
  2. From them: get_time_sync() (servers in the gateway's order, timezone only if the gateway stores a name that maps to an IANA zone without guessing, else None) and get_ntp_servers() from the same read.
  3. Then the write through the same DAL object (_dal_query("TIME", ...) like REBOOT), within the gateway's limits (number of servers, host names allowed), idempotent, with time_sync_writes naming only what the recording shows the gateway takes.
NetOrk/netork#2366 asks this driver to implement napalm-device-types' `TimeSyncMixin` (4.35.0): `get_time_sync()` read on every poll, `configure_time_sync()` written automatically when the gateway differs from its site. It is not done yet, because nothing to build it on is known: - The driver drives Zyxel **VMG residential gateways** over the DAL web API, not a switch CLI. It reads no time settings today: `get_ntp_servers()` returns `{}` ("Not supported on Zyxel VMG"). - The DAL object that holds them (likely `oid=time`, the TR-181 `Device.Time.` object with `NTPServer1`..`NTPServer5` and Zyxel's own zone fields) has never been recorded from a gateway, and the README's "Tested against" table is empty. Building the read and, worse, an automatic write on guessed field names would put guessed values on customer gateways on every poll. ## To do 1. Record, read-only, the gateway's answer to `GET cgi-bin/DAL?oid=time` (and the web UI's "Time Setting" page) from a lab VMG, with the zone set to a named zone and to a plain offset, and with 1 and several NTP servers. Put the recordings into `tests/fixtures/` (addresses replaced). 2. From them: `get_time_sync()` (servers in the gateway's order, `timezone` only if the gateway stores a name that maps to an IANA zone without guessing, else `None`) and `get_ntp_servers()` from the same read. 3. Then the write through the same DAL object (`_dal_query("TIME", ...)` like `REBOOT`), within the gateway's limits (number of servers, host names allowed), idempotent, with `time_sync_writes` naming only what the recording shows the gateway takes.
christianmanivong added the
prio
P3
enhancement
labels 2026-11-11 14:27:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-zyxel#21