@@ -406,19 +406,13 @@ async def test_assign_endpoint_static_varies(dbus, mctpd):
406406
407407""" Test that the mctpd control protocol responder support has support
408408for a basic Get Endpoint ID command"""
409- async def test_get_endpoint_id (dbus , mctpd ):
409+ async def test_get_endpoint_id (dbus , mctpd , routed_ep ):
410+ ep = routed_ep
410411 iface = mctpd .system .interfaces [0 ]
411- dev = mctpd .network .endpoints [0 ]
412412 mctp = await mctpd_mctp_iface_obj (dbus , iface )
413- dev .eid = 12
414-
415- await mctpd .system .add_route (mctpd .system .Route (dev .eid , 0 , iface = iface ))
416- await mctpd .system .add_neighbour (
417- mctpd .system .Neighbour (iface , dev .lladdr , dev .eid )
418- )
419413
420414 cmd = MCTPControlCommand (True , 0 , 0x02 )
421- rsp = await dev .send_control (mctpd .network .mctp_socket , cmd )
415+ rsp = await ep .send_control (mctpd .network .mctp_socket , cmd )
422416
423417 # command code
424418 assert rsp [1 ] == 0x02
@@ -1263,14 +1257,8 @@ async def test_bridge_pool_range_limited(dbus, sysnet, nursery):
12631257 res = await mctpd .stop_mctpd ()
12641258 assert res == 0
12651259
1266- async def test_get_message_types (dbus , mctpd ):
1267- ep = mctpd .network .endpoints [0 ]
1268- ep .eid = 12
1269- iface = mctpd .system .interfaces [0 ]
1270- await mctpd .system .add_route (mctpd .system .Route (ep .eid , 1 , iface = iface ))
1271- await mctpd .system .add_neighbour (
1272- mctpd .system .Neighbour (iface , ep .lladdr , ep .eid )
1273- )
1260+ async def test_get_message_types (dbus , mctpd , routed_ep ):
1261+ ep = routed_ep
12741262
12751263 # Check default response when no responder registered
12761264 cmd = MCTPControlCommand (True , 0 , 0x05 , bytes ([0x00 ]))
@@ -1319,30 +1307,17 @@ async def test_query_peer_properties_retry_timeout(nursery, dbus, sysnet):
13191307 assert res == 0
13201308
13211309""" Test RegisterVDMTypeSupport when no responders are registered """
1322- async def test_register_vdm_type_support_empty (mctpd ):
1323- ep = mctpd .network .endpoints [0 ]
1324- ep .eid = 12
1325- iface = mctpd .system .interfaces [0 ]
1326- await mctpd .system .add_route (mctpd .system .Route (ep .eid , 1 , iface = iface ))
1327- await mctpd .system .add_neighbour (
1328- mctpd .system .Neighbour (iface , ep .lladdr , ep .eid )
1329- )
1310+ async def test_register_vdm_type_support_empty (mctpd , routed_ep ):
1311+ ep = routed_ep
13301312
13311313 # Verify error response when no VDM is registered
13321314 cmd = MCTPControlCommand (True , 0 , 0x06 , bytes ([0x00 ]))
13331315 rsp = await ep .send_control (mctpd .network .mctp_socket , cmd )
13341316 assert rsp .hex (' ' ) == '00 06 02'
13351317
13361318""" Test RegisterVDMTypeSupport when a single PCIe VDM is registered """
1337- async def test_register_vdm_type_support_pcie_only (dbus , mctpd ):
1338- ep = mctpd .network .endpoints [0 ]
1339- ep .eid = 12
1340- iface = mctpd .system .interfaces [0 ]
1341- await mctpd .system .add_route (mctpd .system .Route (ep .eid , 1 , iface = iface ))
1342- await mctpd .system .add_neighbour (
1343- mctpd .system .Neighbour (iface , ep .lladdr , ep .eid )
1344- )
1345-
1319+ async def test_register_vdm_type_support_pcie_only (dbus , mctpd , routed_ep ):
1320+ ep = routed_ep
13461321 mctp = await mctpd_mctp_base_iface_obj (dbus )
13471322
13481323 # Register PCIe VDM: format=0x00, VID=0xABCD, command_set=0x0001
@@ -1360,15 +1335,8 @@ async def test_register_vdm_type_support_pcie_only(dbus, mctpd):
13601335 assert rsp .hex (' ' ) == '00 06 02'
13611336
13621337""" Test RegisterVDMTypeSupport when a single IANA VDM is registered """
1363- async def test_register_vdm_type_support_iana_only (dbus , mctpd ):
1364- ep = mctpd .network .endpoints [0 ]
1365- ep .eid = 12
1366- iface = mctpd .system .interfaces [0 ]
1367- await mctpd .system .add_route (mctpd .system .Route (ep .eid , 1 , iface = iface ))
1368- await mctpd .system .add_neighbour (
1369- mctpd .system .Neighbour (iface , ep .lladdr , ep .eid )
1370- )
1371-
1338+ async def test_register_vdm_type_support_iana_only (dbus , mctpd , routed_ep ):
1339+ ep = routed_ep
13721340 mctp = await mctpd_mctp_base_iface_obj (dbus )
13731341
13741342 # Register IANA VDM: format=0x01, VID=0x1234ABCD, command_set=0x5678
@@ -1381,14 +1349,8 @@ async def test_register_vdm_type_support_iana_only(dbus, mctpd):
13811349 assert rsp .hex (' ' ) == '00 06 00 ff 01 12 34 ab cd 56 78'
13821350
13831351""" Test RegisterVDMTypeSupport with dbus disconnect """
1384- async def test_register_vdm_type_support_dbus_disconnect (mctpd ):
1385- ep = mctpd .network .endpoints [0 ]
1386- ep .eid = 12
1387- iface = mctpd .system .interfaces [0 ]
1388- await mctpd .system .add_route (mctpd .system .Route (ep .eid , 1 , iface = iface ))
1389- await mctpd .system .add_neighbour (
1390- mctpd .system .Neighbour (iface , ep .lladdr , ep .eid )
1391- )
1352+ async def test_register_vdm_type_support_dbus_disconnect (mctpd , routed_ep ):
1353+ ep = routed_ep
13921354
13931355 # Verify error response when no VDM is registered
13941356 cmd = MCTPControlCommand (True , 0 , 0x06 , bytes ([0x00 ]))
@@ -1417,15 +1379,8 @@ async def test_register_vdm_type_support_dbus_disconnect(mctpd):
14171379
14181380""" Test RegisterVDMTypeSupport error handling """
14191381async def test_register_vdm_type_support_errors (dbus , mctpd ):
1420- ep = mctpd .network .endpoints [0 ]
1421- ep .eid = 12
1422- iface = mctpd .system .interfaces [0 ]
1423- await mctpd .system .add_route (mctpd .system .Route (ep .eid , 1 , iface = iface ))
1424- await mctpd .system .add_neighbour (
1425- mctpd .system .Neighbour (iface , ep .lladdr , ep .eid )
1426- )
1427-
14281382 mctp = await mctpd_mctp_base_iface_obj (dbus )
1383+
14291384 # Verify DBus call fails with invalid format 0x02
14301385 v_type = asyncdbus .Variant ('q' , 0xABCD )
14311386 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
0 commit comments