Skip to content

Commit af52df0

Browse files
djgomez-opentronsryanthecoder
authored andcommitted
add mac to the connectivity csv section of robo-diag (#19971)
# Overview Adds an output of the robots WiFi and Ethernet MAC addresses to the Robot diagnostics QC script. Customers have requested the ability to know the MAC address of their robot before they receive it or set it up. By logging the MAC address in the output of the diagnostic scripts we can now look up the MAC address of a robot based on it's serial number in our production database. ## Test Plan and Hands on Testing Ran the test script on a Flex in the office. Checked that the MAC addresses were contained in the output CSV. ## Changelog Modifies the connectivity section of the flex diagnostics QC script in hardware testing to add wifi and ethernet mac address outputs. ## Review requests ## Risk assessment Minimal only impacts hardware testing code Co-authored-by: Ryan Howard <[email protected]>
1 parent 3c9b803 commit af52df0

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

hardware-testing/hardware_testing/production_qc/robot_assembly_qc_ot3/test_connectivity.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,25 +177,29 @@ async def _test_ethernet(api: OT3API, report: CSVReport, section: str) -> None:
177177
ui.get_user_ready("connect ethernet cable")
178178
ethernet_status = await nmcli.iface_info(nmcli.NETWORK_IFACES.ETH_LL)
179179
eth_ip = ethernet_status["ipAddress"]
180+
eth_mac = ethernet_status["macAddress"]
180181
else:
181182
eth_ip = "0.0.0.0"
183+
eth_mac = "AA:AA:AA:AA:AA:AA"
182184
result = CSVResult.from_bool(bool(eth_ip))
183-
report(section, "ethernet", [eth_ip, result])
185+
report(section, "ethernet", [eth_ip, eth_mac, result])
184186

185187

186188
async def _test_wifi(report: CSVReport, section: str) -> None:
187189
ssid = ""
188190
password: Optional[str] = None
189191
result: Optional[CSVResult] = CSVResult.FAIL
190192
wifi_ip: Optional[str] = None
193+
wifi_mac: Optional[str] = None
191194

192195
def _finish() -> None:
193-
report(section, "wifi", [ssid, password, wifi_ip, result])
196+
report(section, "wifi", [ssid, password, wifi_ip, wifi_mac, result])
194197

195198
LOG.info(f"System Architecture: {config.ARCHITECTURE}")
196199
try:
197200
wifi_status = await nmcli.iface_info(nmcli.NETWORK_IFACES.WIFI)
198201
wifi_ip = wifi_status["ipAddress"]
202+
wifi_mac = wifi_status["macAddress"]
199203
if wifi_ip:
200204
result = CSVResult.PASS
201205
return _finish()
@@ -366,8 +370,8 @@ def build_csv_lines() -> List[Union[CSVLine, CSVLineRepeating]]:
366370
]
367371
can_tests = [CSVLine(t, [CSVResult]) for t in AUX_CAN_TESTS]
368372
other_tests = [
369-
CSVLine("ethernet", [str, CSVResult]),
370-
CSVLine("wifi", [str, str, str, CSVResult]),
373+
CSVLine("ethernet", [str, str, CSVResult]),
374+
CSVLine("wifi", [str, str, str, str, CSVResult]),
371375
CSVLine("usb-b-rear", [CSVResult]),
372376
]
373377
return other_tests + usb_a_tests + aux_tests + can_tests # type: ignore[return-value]
@@ -384,7 +388,9 @@ async def run(api: OT3API, report: CSVReport, section: str) -> None:
384388
if not api.is_simulator:
385389
await _test_wifi(report, section)
386390
else:
387-
report(section, "wifi", ["", "", "0.0.0.0", CSVResult.PASS])
391+
report(
392+
section, "wifi", ["", "", "0.0.0.0", "AA:AA:AA:AA:AA:AA", CSVResult.PASS]
393+
)
388394
assert nmcli.iface_info is not None
389395
assert nmcli.configure is not None
390396
assert nmcli.wifi_disconnect is not None

0 commit comments

Comments
 (0)