Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e371db3af | ||
|
|
872e5718a3 | ||
|
|
77313ca436 |
@@ -68,6 +68,17 @@ class QnapQtsDriver(StorageDriver, HypervisorDriver, LinuxDriver):
|
||||
driver_name = "qnap_qts"
|
||||
NETMIKO_DEVICE_TYPE = "linux"
|
||||
|
||||
#: QTS has no systemd, so the systemctl actions LinuxDriver inherits from
|
||||
#: napalm-device-types' SystemdServicesMixin would fail on every unit. None
|
||||
#: makes every "can it control services?" check -- is ``manage_service``
|
||||
#: callable -- answer no, rather than offering buttons that cannot work.
|
||||
manage_service = None # type: ignore[assignment]
|
||||
#: The same for updates: QTS has no apt, dnf or opkg, and QPKG updates are
|
||||
#: not implemented. netOrk leaves a driver without them out of patching.
|
||||
get_available_updates = None # type: ignore[assignment]
|
||||
refresh_available_updates = None # type: ignore[assignment]
|
||||
apply_updates = None # type: ignore[assignment]
|
||||
|
||||
SNMP_OBJECT_ID_PREFIX = QNAP_ENTERPRISE_OID
|
||||
SNMP_FINGERPRINT = [
|
||||
FingerprintRule("qnap", weight=9.0),
|
||||
|
||||
@@ -182,3 +182,23 @@ 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))
|
||||
|
||||
|
||||
|
||||
def test_updates_are_not_read_or_applied_here():
|
||||
"""QTS has no apt, dnf or opkg: the readers inherited from LinuxDriver find no
|
||||
package manager, and QPKG updates are not implemented. Saying so keeps QNAP out
|
||||
of netOrk's patch groups and compliance report, which ask whether these
|
||||
methods are callable."""
|
||||
for method in ("get_available_updates", "refresh_available_updates", "apply_updates"):
|
||||
assert not callable(getattr(QnapQtsDriver, method, None)), method
|
||||
|
||||
Reference in New Issue
Block a user