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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user