From d5362fd382686fcff2ed10cd364ced52c26cc899 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Sun, 1 Nov 2026 21:54:55 +0100 Subject: [PATCH] fix(fingerprint): drop the GS1920 and GS2210 switch patterns GS1920 and GS2210 are Zyxel switches. Counting them as evidence for a VMG gateway driver made discovery score a Zyxel switch higher for this driver than a real VMG gateway. Closes #4 --- CHANGELOG.md | 3 +++ napalm_zyxel/zyxel_driver.py | 2 -- tests/test_zyxel.py | 12 ++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e5098c..3d5e3d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ All notable changes to this driver. The format follows - `get_arp_table()` reports an unknown age as `-1.0` (napalm-device-types' `ARP_AGE_UNKNOWN`) instead of `0.0`, which means "confirmed just now": the host list says a host is active, not when the gateway last saw it (NetOrk/netork#1327). +- The HTTP fingerprint no longer counts `gs1920` and `gs2210` as evidence for this + driver: they are Zyxel switches, and discovery offered this gateway driver for + them (#4). ## [0.3.0] - 2026-10-23 diff --git a/napalm_zyxel/zyxel_driver.py b/napalm_zyxel/zyxel_driver.py index cab9c88..f2afa6d 100644 --- a/napalm_zyxel/zyxel_driver.py +++ b/napalm_zyxel/zyxel_driver.py @@ -95,8 +95,6 @@ class ZyxelVMGDriver(ResidentialGatewayDriver): OUI_PREFIXES = ["00:13:49", "1C:74:0D", "C8:6C:87", "B0:B2:DC", "28:28:5D"] HTTP_FINGERPRINT = [ FingerprintRule("zyxel", weight=7.0, mandatory=True), - FingerprintRule("gs1920", weight=6.0), - FingerprintRule("gs2210", weight=6.0), ] _LOGIN_PATH = "UserLogin" diff --git a/tests/test_zyxel.py b/tests/test_zyxel.py index ed80de2..82bbf75 100644 --- a/tests/test_zyxel.py +++ b/tests/test_zyxel.py @@ -421,3 +421,15 @@ class TestZyxelVMGDriver: def test_cli(self): self._setup_mocked_http() assert self.driver.cli(["show version"]) == {} + + +@pytest.mark.parametrize("switch_model", ["gs1920", "gs2210"]) +def test_a_zyxel_switch_page_adds_no_evidence_for_this_gateway(switch_model): + """GS1920 and GS2210 are Zyxel switches, not VMG gateways.""" + page = f"zyxel {switch_model}-24hp web configurator" + matching = [ + rule.pattern + for rule in ZyxelVMGDriver.HTTP_FINGERPRINT + if not rule.negative and rule.pattern != "zyxel" and rule.pattern in page + ] + assert matching == []