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
This commit is contained in:
1 parent
7fbb7034d3
commit
d5362fd382
3 files changed
+15
-2
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 == []
|
||||
Reference in new issue
Block a user