From b902184ce384d70dd2a4e5a3f02321b124dfedd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 13 Apr 2024 21:59:04 +0200 Subject: [PATCH] PROVISORY: ci: testbed-device.py: workaround MxL very generic DTS compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While integrating support for OSPv2, also known as MXL25641-HDK-6, I discovered that it's impossible to uniquely identify the machine. This is because the /proc/device-tree/compatible (DTS Root Node) is identical across all MxL boards. So lets workaround it by using `/proc/device-tree/model` additionally, which at least help distinguish between OSPv1 and OSPv2, thus we first check for `compatible` and if not usable, then fallback to `model` property. References: PCF-1161 Signed-off-by: Petr Štetiar --- .gitlab/scripts/testbed-device.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab/scripts/testbed-device.py b/.gitlab/scripts/testbed-device.py index 5219293807..d93d0de361 100755 --- a/.gitlab/scripts/testbed-device.py +++ b/.gitlab/scripts/testbed-device.py @@ -139,13 +139,14 @@ class TestbedDevice: def _init_lan_vlan(self): bridge_lan_ports = { - "mxl,lgm": "Bridging.Bridge.1.Port.3", + "mxl,lightning mountainmxl,lgp": "Bridging.Bridge.1.Port.3", "prpl,haze": "Bridging.Bridge.1.Port.4", "cznic,turris-omnia": "Bridging.Bridge.2.Port.5", "EASY350 ANYWAN (GRX350) Axepoint Asurada model": "Bridging.Bridge.1.Port.5", } bridge_vlan_port = bridge_lan_ports.get( - self.board_name, "Bridging.Bridge.1.Port.2" + self.board_name, + bridge_lan_ports.get(self.model, "Bridging.Bridge.1.Port.2"), ) self.shell.run('ubus-cli Bridging.Bridge.1.Standard="802.1Q-2005"') @@ -171,8 +172,9 @@ class TestbedDevice: logging.error("Unable to determine running DUT board!") return + self.model = system_info["model"] self.board_name = system_info["board_name"] - logging.info(f"Running on {self.board_name} board") + logging.info(f"Running on `{self.board_name}` board, model is `{self.model}`.") self.ubus_tr181 = UbusTR181(self.args, self.shell) self._init_wan_vlan()