From f1d191c52a6f94a8271e4d83299cd8f4661ed71c Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Wed, 11 Nov 2026 15:18:56 +0100 Subject: [PATCH] fix(time-sync): switch off the POSIX time sync on QTS napalm-linux now brings napalm-device-types' PosixTimeSyncMixin (4.35.0). QTS has no systemd and no timedatectl, and its NTP client and time zone are QTS settings: the inherited reading finds no client there and every write fails its step, a difference netOrk could report on every poll but never fix (NetOrk/netork#2370). get_time_sync and configure_time_sync are None, so a capability check answers no, until a QTS variant is built against a real box. The floor rises to napalm-device-types 4.35.0. --- CHANGELOG.md | 5 +++++ README.md | 1 + napalm_qnap_qts/qnap_qts.py | 5 +++++ pyproject.toml | 2 +- tests/test_qnap_qts.py | 13 +++++++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20534f0..cd2ce6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed +- `get_time_sync` and `configure_time_sync`, which napalm-linux brings through + napalm-device-types' `PosixTimeSyncMixin` (4.35.0), are switched off: QTS has no systemd + and no `timedatectl`, and its NTP client and time zone are QTS settings. The POSIX + reading would find no client and every write would fail, a difference netOrk could + never fix (NetOrk/netork#2370). Needs napalm-device-types 4.35.0. - `remove_local_account_keys`, which napalm-linux 0.17.0 brings, is switched off like the other personal-account actions: QTS manages its users in its own UI (NetOrk/netork#2013). Needs napalm-device-types 4.28.0 and napalm-linux 0.17.0. diff --git a/README.md b/README.md index fb53fb1..b1a87cd 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ output is how a driver ends up passing its own tests and failing on a real NAS. | `manage_scheduled_job` | the crontab, then `crontab` + `crond.sh restart`; the firmware's lines only run | ✅ synthetic fixtures | | `put_scheduled_job`, `delete_scheduled_job` | marked lines in `/etc/config/crontab`, as admin | ✅ synthetic fixtures | | `ping`, `ping_sweep` | inherited from `LinuxDriver` | ✅ | +| `get_time_sync`, `configure_time_sync` | — (QTS settings; no systemd or `timedatectl`) | switched off until a QTS variant (NetOrk/netork#2370) | | Snapshots, quotas, replication, QPKG install/remove | — | out of scope for v1 | ## Requirements diff --git a/napalm_qnap_qts/qnap_qts.py b/napalm_qnap_qts/qnap_qts.py index bcfa070..8c5cbde 100644 --- a/napalm_qnap_qts/qnap_qts.py +++ b/napalm_qnap_qts/qnap_qts.py @@ -103,6 +103,11 @@ class QnapQtsDriver(StorageDriver, HypervisorDriver, QtsScheduledJobsMixin, Linu lock_local_account = None # type: ignore[assignment] add_service_account = None # type: ignore[assignment] remove_local_account_keys = None # type: ignore[assignment] + #: QTS has no systemd and no timedatectl; its NTP client and zone are QTS + #: settings. LinuxDriver's POSIX time sync would read no client and fail every + #: write: off until a QTS variant is built against a real box (NetOrk/netork#2370). + get_time_sync = None # type: ignore[assignment] + configure_time_sync = None # type: ignore[assignment] SNMP_OBJECT_ID_PREFIX = QNAP_ENTERPRISE_OID SNMP_FINGERPRINT = [ diff --git a/pyproject.toml b/pyproject.toml index 4c235bf..4b7cb8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ classifiers = [ # processes, Docker) from LinuxDriver rather than reimplementing it. dependencies = [ "napalm>=4.0", - "napalm-device-types>=4.28.0", + "napalm-device-types>=4.35.0", "napalm-linux>=0.17.0", "netmiko>=4.0.0", "paramiko>=5.0.0", # CVE-2026-44405 diff --git a/tests/test_qnap_qts.py b/tests/test_qnap_qts.py index d1cf003..fb24da5 100644 --- a/tests/test_qnap_qts.py +++ b/tests/test_qnap_qts.py @@ -248,6 +248,19 @@ def test_personal_accounts_are_not_managed_here(): assert not callable(getattr(QnapQtsDriver, action, None)) +def test_time_sync_is_not_read_or_set_here(): + """QTS has no systemd and no ``timedatectl``, and its NTP client and zone are QTS + settings: the POSIX reading inherited from LinuxDriver finds no client there, and + its write fails. Off until a QTS variant is built against a real box + (NetOrk/netork#2370), so netOrk neither reports a difference it cannot fix nor + tries to fix it.""" + from napalm_linux.linux import LinuxDriver + + for method in ("get_time_sync", "configure_time_sync"): + assert callable(getattr(LinuxDriver, method, None)), method + assert not callable(getattr(QnapQtsDriver, method, None)), method + + class TestFixesQtsCannotTake: """QTS has no apt, dnf or opkg, and its SNMP agent is configured in its own UI: the fix templates inherited from LinuxDriver are switched off (#7), so a