From a282836bd2512ed0d985023366d9808db0181fd0 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Thu, 12 Nov 2026 18:32:40 +0100 Subject: [PATCH] test: placeholders for the serial number and MAC addresses in fixtures The fixtures are a real gateway's answers. Its serial number and its MAC addresses identify that one device and do not belong in a public repository; the tests only need values of the right shape. The MACs keep Zyxel's OUI. --- tests/test_facts.py | 7 ++++--- tests/test_interfaces.py | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/test_facts.py b/tests/test_facts.py index 2e516fd..acabc89 100644 --- a/tests/test_facts.py +++ b/tests/test_facts.py @@ -12,7 +12,8 @@ from (#27). ``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 -``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 @@ -46,7 +47,7 @@ STATUS: dict[str, Any] = { { "DeviceInfo": { "ModelName": "VMG4005-B50A", - "SerialNumber": "S250Y02049498", + "SerialNumber": "S000Y00000001", "SoftwareVersion": "V5.17(ABQA.3.1)C0", "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(): - 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(): diff --git a/tests/test_interfaces.py b/tests/test_interfaces.py index a1d7b0e..10b8820 100644 --- a/tests/test_interfaces.py +++ b/tests/test_interfaces.py @@ -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. ``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 @@ -30,7 +30,7 @@ CARDPAGE: dict[str, Any] = { { "Enable": True, "X_ZYXEL_Type": "LAN", - "MACAddress": "6c:4f:89:6a:bf:50", + "MACAddress": "6c:4f:89:00:00:50", "Status": "Up", "X_ZYXEL_SrvName": "Default", "Name": "LAN", @@ -73,7 +73,7 @@ CARDPAGE: dict[str, Any] = { "Enable": True, "Status": "Up", "Name": "eth1", - "MACAddress": "6c:4f:89:6a:bf:53", + "MACAddress": "6c:4f:89:00:00:53", "MaxBitRate": 1000, "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(): 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["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(): eth1 = _driver(CARDPAGE).get_interfaces()["eth1"] 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["is_up"] is True -- 2.54.0