diff --git a/CHANGELOG.md b/CHANGELOG.md index 8167b5d..b7aa38b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ All notable changes to this driver. The format follows napalm-device-types' `ARP_AGE_UNKNOWN`) instead of `0.0`, which means "confirmed just now". The "Age (min)" column of `show arp` is not parsed until real switch output confirms its format (NetOrk/netork#1327). +- A Netgear Plus switch is no longer offered as a ping-sweep source + (`supports_ping()` is `False`): its `ping` only raised, so every target of a sweep + came back as an error. `ping` still raises `NotImplementedError`, now NAPALM's own. ### Removed - **Breaking:** the Netgear Plus driver no longer has `set_vlan`, `delete_vlan` and diff --git a/napalm_netgear/netgear_plus.py b/napalm_netgear/netgear_plus.py index 4bd074c..a547536 100644 --- a/napalm_netgear/netgear_plus.py +++ b/napalm_netgear/netgear_plus.py @@ -548,23 +548,6 @@ class NetgearPlusDriver(FirmwareOfferMixin, SwitchDriver): def has_pending_commit(self) -> bool: return False - def ping( - self, - destination: str, - source: str = "", - ttl: int = 255, - timeout: int = 2, - size: int = 100, - count: int = 5, - vrf: str = "", - source_interface: str = "", - ) -> dict[str, Any]: - """Execute ping. - - Not supported on Netgear Plus switches via HTTP. - """ - raise NotImplementedError("ping() is not supported for Netgear Plus switches.") - def traceroute( self, destination: str, diff --git a/tests/unit/test_plus_capabilities.py b/tests/unit/test_plus_capabilities.py index e51286e..15d516a 100644 --- a/tests/unit/test_plus_capabilities.py +++ b/tests/unit/test_plus_capabilities.py @@ -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