Merge pull request 'test: placeholders for the serial number and MAC addresses in fixtures' (#30) from chore/anonymise-fixtures into main
driver / standard (push) Successful in 15s
driver / lint (push) Successful in 14s
driver / types (push) Successful in 57s
driver / test (3.13) (push) Successful in 56s
driver / test (3.12) (push) Successful in 1m3s
driver / lowest (push) Successful in 25s
driver / build (push) Successful in 25s
driver / security (push) Successful in 56s
CI / driver (push) Successful in 2m8s
driver / publish (push) Skipped

This commit was merged in pull request #30.
This commit is contained in:
christianmanivong committed 2026-11-12 17:38:46 +00:00
commit e05101f282
2 files changed
+9 -8

No files matched your search

+4 -3
View File
@@ -12,7 +12,8 @@ from (#27).
``BASIC_INFO`` and ``SYSTEM`` are those two answers from that gateway (the SNMP ``BASIC_INFO`` and ``SYSTEM`` are those two answers from that gateway (the SNMP
community strings the System answer can carry are left out), ``STATUS`` its community strings the System answer can carry are left out), ``STATUS`` its
``cardpage_status`` cut down to ``DeviceInfo`` and one interface. ``cardpage_status`` cut down to ``DeviceInfo`` and one interface, with the serial
number replaced by a placeholder.
""" """
from __future__ import annotations from __future__ import annotations
@@ -46,7 +47,7 @@ STATUS: dict[str, Any] = {
{ {
"DeviceInfo": { "DeviceInfo": {
"ModelName": "VMG4005-B50A", "ModelName": "VMG4005-B50A",
"SerialNumber": "S250Y02049498", "SerialNumber": "S000Y00000001",
"SoftwareVersion": "V5.17(ABQA.3.1)C0", "SoftwareVersion": "V5.17(ABQA.3.1)C0",
"UpTime": 13544274, "UpTime": 13544274,
}, },
@@ -145,7 +146,7 @@ def test_get_facts_raises_on_a_system_page_it_cannot_read(answer: Any):
def test_the_serial_number_is_the_one_on_the_status_page(): def test_the_serial_number_is_the_one_on_the_status_page():
assert _driver().get_facts()["serial_number"] == "S250Y02049498" assert _driver().get_facts()["serial_number"] == "S000Y00000001"
def test_the_uptime_is_the_one_on_the_status_page(): def test_the_uptime_is_the_one_on_the_status_page():
+5 -5
View File
@@ -8,7 +8,7 @@ all of that. Both now read the DAL's ``cardpage_status``: the IP interfaces in
yet: the gateway this was taken from has IPv6 off and so shows none to learn from. yet: the gateway this was taken from has IPv6 off and so shows none to learn from.
``CARDPAGE`` is that answer from a VMG4005-B50A (V5.17(ABQA.3.1)C0), cut down to the ``CARDPAGE`` is that answer from a VMG4005-B50A (V5.17(ABQA.3.1)C0), cut down to the
fields the driver reads. fields the driver reads, with placeholder MAC addresses under Zyxel's OUI.
""" """
from __future__ import annotations from __future__ import annotations
@@ -30,7 +30,7 @@ CARDPAGE: dict[str, Any] = {
{ {
"Enable": True, "Enable": True,
"X_ZYXEL_Type": "LAN", "X_ZYXEL_Type": "LAN",
"MACAddress": "6c:4f:89:6a:bf:50", "MACAddress": "6c:4f:89:00:00:50",
"Status": "Up", "Status": "Up",
"X_ZYXEL_SrvName": "Default", "X_ZYXEL_SrvName": "Default",
"Name": "LAN", "Name": "LAN",
@@ -73,7 +73,7 @@ CARDPAGE: dict[str, Any] = {
"Enable": True, "Enable": True,
"Status": "Up", "Status": "Up",
"Name": "eth1", "Name": "eth1",
"MACAddress": "6c:4f:89:6a:bf:53", "MACAddress": "6c:4f:89:00:00:53",
"MaxBitRate": 1000, "MaxBitRate": 1000,
"X_ZYXEL_LanPort": "LAN1", "X_ZYXEL_LanPort": "LAN1",
} }
@@ -133,7 +133,7 @@ def test_an_ip_interface_is_up_only_when_the_gateway_says_so():
def test_an_ip_interface_carries_its_own_mac_and_name(): def test_an_ip_interface_carries_its_own_mac_and_name():
br0 = _driver(CARDPAGE).get_interfaces()["br0"] br0 = _driver(CARDPAGE).get_interfaces()["br0"]
assert br0["mac_address"] == "6c:4f:89:6a:bf:50" assert br0["mac_address"] == "6c:4f:89:00:00:50"
assert br0["description"] == "LAN" assert br0["description"] == "LAN"
assert br0["is_enabled"] is True assert br0["is_enabled"] is True
@@ -145,7 +145,7 @@ def test_a_wan_bridge_is_named_after_its_service():
def test_an_ethernet_port_carries_its_speed_mac_and_label(): def test_an_ethernet_port_carries_its_speed_mac_and_label():
eth1 = _driver(CARDPAGE).get_interfaces()["eth1"] eth1 = _driver(CARDPAGE).get_interfaces()["eth1"]
assert eth1["speed"] == 1000.0 assert eth1["speed"] == 1000.0
assert eth1["mac_address"] == "6c:4f:89:6a:bf:53" assert eth1["mac_address"] == "6c:4f:89:00:00:53"
assert eth1["description"] == "LAN1" assert eth1["description"] == "LAN1"
assert eth1["is_up"] is True assert eth1["is_up"] is True