test: placeholders for the serial number and MAC addresses in fixtures #30
No files matched your search
+4
-3
@@ -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():
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user