fix: do not claim service control QTS cannot do

QnapQtsDriver inherits LinuxDriver, which now has manage_service() through
napalm-device-types' SystemdServicesMixin. QTS has no systemd, so every
action would fail. manage_service = None makes every capability check --
is manage_service callable -- answer no, so netOrk offers no controls that
cannot work.
This commit is contained in:
Christian Manivong
2026-10-05 13:12:16 +02:00
parent b4fe7c7a91
commit 77313ca436
2 changed files with 16 additions and 0 deletions
+10
View File
@@ -182,3 +182,13 @@ class TestDockerBinDiscovery:
def test_docker_bin_hook_returns_the_discovered_path(self, driver):
driver._docker_path = "/opt/docker"
assert driver._docker_bin() == "/opt/docker"
def test_services_cannot_be_controlled():
"""QTS has no systemd: the systemctl actions inherited from LinuxDriver would
fail on every unit, so the driver says it cannot control services at all --
which is what every capability check asks (is ``manage_service`` callable?)."""
from napalm_linux.linux import LinuxDriver
assert callable(getattr(LinuxDriver, "manage_service", None))
assert not callable(getattr(QnapQtsDriver, "manage_service", None))