fix(plus): leave ping to NAPALM so sweeps skip Plus switches

The Plus driver overrode ping only to raise NotImplementedError. An
override is what napalm-device-types' driver_supports_ping looks for, so
the driver was offered as a ping-sweep source and every target came back
as an error. Without the override it inherits NAPALM's stub, which
raises the same way and reads as unsupported.

Closes #5
This commit is contained in:
Christian Manivong committed 2026-11-01 21:54:31 +01:00
1 parent 6f9914f29e
commit 3e333d6bfd
3 files changed
+15 -18

No files matched your search

+12 -1
View File
@@ -2,7 +2,8 @@
An application reads a capability from the method being there: netOrk offers
"Add VLAN" and the port VLAN editor when ``set_vlan`` / ``set_interface`` are
callable (#9). A method that only raises NotImplementedError
callable (#9), and napalm-device-types takes a driver with a ``ping`` of its
own as a ping-sweep source (#5). A method that only raises NotImplementedError
made the HTTP-only Plus switches look able to do it.
"""
@@ -11,8 +12,18 @@ from __future__ import annotations
import pytest
from napalm_netgear.netgear_plus import NetgearPlusDriver
from napalm_netgear.netgear_smart import NetgearSmartDriver
@pytest.mark.parametrize("method", ["set_vlan", "delete_vlan", "set_interface"])
def test_plus_has_no_vlan_or_port_writes(method):
assert not callable(getattr(NetgearPlusDriver, method, None))
def test_plus_is_no_ping_sweep_source():
"""Its ping only raised, so every sweep target came back as an error (#5)."""
assert NetgearPlusDriver.supports_ping() is False
def test_smart_still_is_a_ping_sweep_source():
assert NetgearSmartDriver.supports_ping() is True