"""The switch's SNMP health OIDs, declared as data (napalm-device-types docs/STRUCTURE.md). The driver does not collect over SNMP; the application polls with this profile. """ from napalm_procurve.procurve import ProcurveDriver PROFILE = ProcurveDriver.SNMP_HEALTH_PROFILE MEM = "1.3.6.1.4.1.11.2.14.11.5.1.1.2.1.1.1" # NETSWITCH-MIB hpLocalMemEntry def test_the_driver_does_not_collect_itself(): assert "get_health_metrics" not in vars(ProcurveDriver) def test_uptime_from_the_switch_mib(): assert PROFILE["uptime"] == {"oids": ["1.3.6.1.4.1.11.2.14.11.1.2.4.1.5.1"]} def test_cpu_from_the_current_oid_then_the_older_firmware_s(): assert PROFILE["cpu"] == { "oids": ["1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0", "1.3.6.1.4.1.11.2.3.7.8.6.1.0"] } def test_memory_column_6_is_free_not_used(): # On swt-l0-3-40 (2026-10-16): total (.5) 58720256 = free (.6) 39105640 # + allocated (.7) 19614616. Read as "used", .6 showed 66.6 % instead of 33.4 % (#9). assert PROFILE["memory"] == { "total": {"oids": [f"{MEM}.5.1"]}, "free": {"oids": [f"{MEM}.6.1"]}, "unit": "bytes", }