@@ -1319,8 +1319,8 @@ async def test_register_vdm_type_support_pcie_only(dbus, mctpd):
13191319 mctp = await mctpd_mctp_base_iface_obj (dbus )
13201320
13211321 # Register PCIe VDM: format=0x00, VID=0xABCD, command_set=0x0001
1322- await mctp . call_register_vdm_type_support ( 0x00 ,
1323- asyncdbus . Variant ( 'q' , 0xABCD ) , 0x0001 )
1322+ v_type = asyncdbus . Variant ( 'q' , 0xABCD )
1323+ await mctp . call_register_vdm_type_support ( 0x00 , v_type , 0x0001 )
13241324
13251325 # Verify PCIe VDM (selector 0)
13261326 cmd = MCTPControlCommand (True , 0 , 0x06 , bytes ([0x00 ]))
@@ -1345,8 +1345,8 @@ async def test_register_vdm_type_support_iana_only(dbus, mctpd):
13451345 mctp = await mctpd_mctp_base_iface_obj (dbus )
13461346
13471347 # Register IANA VDM: format=0x01, VID=0x1234ABCD, command_set=0x5678
1348- await mctp . call_register_vdm_type_support ( 0x01 ,
1349- asyncdbus . Variant ( 'u' , 0x1234ABCD ) , 0x5678 )
1348+ v_type = asyncdbus . Variant ( 'u' , 0x1234ABCD )
1349+ await mctp . call_register_vdm_type_support ( 0x01 , v_type , 0x5678 )
13501350
13511351 # Verify IANA VDM (selector 0)
13521352 cmd = MCTPControlCommand (True , 0 , 0x06 , bytes ([0x00 ]))
@@ -1372,8 +1372,8 @@ async def test_register_vdm_type_support_dbus_disconnect(mctpd):
13721372 mctp = await mctpd_mctp_base_iface_obj (temp_bus )
13731373
13741374 # Register PCIe VDM: format=0x00, VID=0xABCD, command_set=0x0001
1375- await mctp . call_register_vdm_type_support ( 0x00 ,
1376- asyncdbus . Variant ( 'q' , 0xABCD ) , 0x0001 )
1375+ v_type = asyncdbus . Variant ( 'q' , 0xABCD )
1376+ await mctp . call_register_vdm_type_support ( 0x00 , v_type , 0x0001 )
13771377
13781378 # Verify PCIe VDM (selector 0)
13791379 cmd = MCTPControlCommand (True , 0 , 0x06 , bytes ([0x00 ]))
@@ -1400,25 +1400,24 @@ async def test_register_vdm_type_support_errors(dbus, mctpd):
14001400
14011401 mctp = await mctpd_mctp_base_iface_obj (dbus )
14021402 # Verify DBus call fails with invalid format 0x02
1403+ v_type = asyncdbus .Variant ('q' , 0xABCD )
14031404 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
1404- await mctp .call_register_vdm_type_support (0x02 ,
1405- asyncdbus .Variant ('q' , 0xABCD ), 0x0001 )
1405+ await mctp .call_register_vdm_type_support (0x02 , v_type , 0x0001 )
14061406 assert "Unsupported VID format" in str (ex .value )
14071407
14081408 # Verify incorrect VID type raises error
1409+ v_type = asyncdbus .Variant ('u' , 0xABCDEF12 )
14091410 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
1410- await mctp .call_register_vdm_type_support (0x00 ,
1411- asyncdbus .Variant ('u' , 0xABCDEF12 ), 0x0001 )
1411+ await mctp .call_register_vdm_type_support (0x00 , v_type , 0x0001 )
14121412 assert "Expected format is PCIe but variant contains" in str (ex .value )
1413+
1414+ v_type = asyncdbus .Variant ('q' , 0xABCD )
14131415 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
1414- await mctp .call_register_vdm_type_support (0x01 ,
1415- asyncdbus .Variant ('q' , 0xABCD ), 0x5678 )
1416+ await mctp .call_register_vdm_type_support (0x01 , v_type , 0x5678 )
14161417 assert "Expected format is IANA but variant contains" in str (ex .value )
14171418
14181419 # Verify duplicate VDM raises error
1419- await mctp .call_register_vdm_type_support (0x00 ,
1420- asyncdbus .Variant ('q' , 0xABCD ), 0x0001 )
1420+ await mctp .call_register_vdm_type_support (0x00 , v_type , 0x0001 )
14211421 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
1422- await mctp .call_register_vdm_type_support (0x00 ,
1423- asyncdbus .Variant ('q' , 0xABCD ), 0x0001 )
1424- assert str (ex .value ) == "VDM type already registered"
1422+ await mctp .call_register_vdm_type_support (0x00 , v_type , 0x0001 )
1423+ assert str (ex .value ) == "VDM type already registered"
0 commit comments