"""What netOrk's discovery scores the driver on. netOrk lowercases the page (title, Server header, body) and matches each rule's pattern as a substring; a port that answers adds its PortSpec weight. AMT names itself in its ``Server`` header on every answer, also the 401 of a page that needs a login. """ from napalm_device_types.base import rules_max_weight from napalm_amt import AmtDriver def _score(text: str) -> float: text = " ".join(text.lower().split()) return sum(rule.weight for rule in AmtDriver.HTTP_FINGERPRINT if rule.pattern in text) def test_amt_ports_are_probed(): assert {(s.scheme, s.port) for s in AmtDriver.PORT_SPECS} == {("http", 16992), ("https", 16993)} def test_server_header_is_recognised(): assert _score("Intel(R) Active Management Technology 11.8.50.3399") >= 10.0 def test_web_ui_landing_page_is_recognised(): page = ( "