PROVISORY: ci: testbed-device.py: workaround MxL very generic DTS compatible

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 <petr.stetiar@prplfoundation.org>
This commit is contained in:
Petr Štetiar 2024-04-13 21:59:04 +02:00
parent 4f059a8512
commit b902184ce3
No known key found for this signature in database
GPG Key ID: 58EE120F30CC02D3

View File

@ -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()