Files
napalm-tplink-jetstream/tests/unit/test_snmp_profile.py
T
Christian Manivong b01d70aa3c
Tests / Test (Python 3.10) (pull_request) Successful in 22s
Tests / Test (Python 3.11) (pull_request) Successful in 21s
Tests / Test (Python 3.12) (pull_request) Successful in 24s
feat: declare the SNMP health OIDs instead of collecting them (0.2.0)
The driver no longer collects over SNMP. SNMP_HEALTH_PROFILE states
where the switch publishes uptime (TimeTicks), CPU and memory (tables
with one row per stack unit, first row as before); the application
polls and computes (napalm-device-types docs/STRUCTURE.md).

Interface counters now come from the 64-bit ifXTable where the switch
has it, as the application reads them for every device.
2026-10-16 12:02:32 +02:00

26 lines
963 B
Python

"""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_tplink_jetstream.tplink_jetstream import TPLinkJetstreamDriver
PROFILE = TPLinkJetstreamDriver.SNMP_HEALTH_PROFILE
def test_the_driver_does_not_collect_itself():
assert "get_health_metrics" not in vars(TPLinkJetstreamDriver)
def test_uptime_in_timeticks_from_the_tp_link_mib():
# swt-l2-3-38 answered 129434122 (2026-10-16): TimeTicks, about 15 days.
assert PROFILE["uptime"] == {"oids": ["1.3.6.1.4.1.11863.6.1.1.9.0"]}
def test_cpu_and_memory_per_unit_take_the_first_row():
# One row per stack unit; a single switch answers row 1 only.
assert PROFILE["cpu"] == {"table": "1.3.6.1.4.1.11863.6.4.1.1.1.1.3", "fold": "first"}
assert PROFILE["memory"] == {
"percent": {"table": "1.3.6.1.4.1.11863.6.4.1.2.1.1.2", "fold": "first"}
}