@@ -1432,8 +1432,8 @@ async def test_register_vdm_type_support_pcie_only(dbus, mctpd):
14321432 mctp = await mctpd_mctp_base_iface_obj (dbus )
14331433
14341434 # Register PCIe VDM: format=0x00, VID=0xABCD, command_set=0x0001
1435- await mctp . call_register_vdm_type_support ( 0x00 ,
1436- asyncdbus . Variant ( 'q' , 0xABCD ) , 0x0001 )
1435+ v_type = asyncdbus . Variant ( 'q' , 0xABCD )
1436+ await mctp . call_register_vdm_type_support ( 0x00 , v_type , 0x0001 )
14371437
14381438 # Verify PCIe VDM (selector 0)
14391439 cmd = MCTPControlCommand (True , 0 , 0x06 , bytes ([0x00 ]))
@@ -1458,8 +1458,8 @@ async def test_register_vdm_type_support_iana_only(dbus, mctpd):
14581458 mctp = await mctpd_mctp_base_iface_obj (dbus )
14591459
14601460 # Register IANA VDM: format=0x01, VID=0x1234ABCD, command_set=0x5678
1461- await mctp . call_register_vdm_type_support ( 0x01 ,
1462- asyncdbus . Variant ( 'u' , 0x1234ABCD ) , 0x5678 )
1461+ v_type = asyncdbus . Variant ( 'u' , 0x1234ABCD )
1462+ await mctp . call_register_vdm_type_support ( 0x01 , v_type , 0x5678 )
14631463
14641464 # Verify IANA VDM (selector 0)
14651465 cmd = MCTPControlCommand (True , 0 , 0x06 , bytes ([0x00 ]))
@@ -1485,8 +1485,8 @@ async def test_register_vdm_type_support_dbus_disconnect(mctpd):
14851485 mctp = await mctpd_mctp_base_iface_obj (temp_bus )
14861486
14871487 # Register PCIe VDM: format=0x00, VID=0xABCD, command_set=0x0001
1488- await mctp . call_register_vdm_type_support ( 0x00 ,
1489- asyncdbus . Variant ( 'q' , 0xABCD ) , 0x0001 )
1488+ v_type = asyncdbus . Variant ( 'q' , 0xABCD )
1489+ await mctp . call_register_vdm_type_support ( 0x00 , v_type , 0x0001 )
14901490
14911491 # Verify PCIe VDM (selector 0)
14921492 cmd = MCTPControlCommand (True , 0 , 0x06 , bytes ([0x00 ]))
@@ -1513,25 +1513,24 @@ async def test_register_vdm_type_support_errors(dbus, mctpd):
15131513
15141514 mctp = await mctpd_mctp_base_iface_obj (dbus )
15151515 # Verify DBus call fails with invalid format 0x02
1516+ v_type = asyncdbus .Variant ('q' , 0xABCD )
15161517 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
1517- await mctp .call_register_vdm_type_support (0x02 ,
1518- asyncdbus .Variant ('q' , 0xABCD ), 0x0001 )
1518+ await mctp .call_register_vdm_type_support (0x02 , v_type , 0x0001 )
15191519 assert "Unsupported VID format" in str (ex .value )
15201520
15211521 # Verify incorrect VID type raises error
1522+ v_type = asyncdbus .Variant ('u' , 0xABCDEF12 )
15221523 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
1523- await mctp .call_register_vdm_type_support (0x00 ,
1524- asyncdbus .Variant ('u' , 0xABCDEF12 ), 0x0001 )
1524+ await mctp .call_register_vdm_type_support (0x00 , v_type , 0x0001 )
15251525 assert "Expected format is PCIe but variant contains" in str (ex .value )
1526+
1527+ v_type = asyncdbus .Variant ('q' , 0xABCD )
15261528 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
1527- await mctp .call_register_vdm_type_support (0x01 ,
1528- asyncdbus .Variant ('q' , 0xABCD ), 0x5678 )
1529+ await mctp .call_register_vdm_type_support (0x01 , v_type , 0x5678 )
15291530 assert "Expected format is IANA but variant contains" in str (ex .value )
15301531
15311532 # Verify duplicate VDM raises error
1532- await mctp .call_register_vdm_type_support (0x00 ,
1533- asyncdbus .Variant ('q' , 0xABCD ), 0x0001 )
1533+ await mctp .call_register_vdm_type_support (0x00 , v_type , 0x0001 )
15341534 with pytest .raises (asyncdbus .errors .DBusError ) as ex :
1535- await mctp .call_register_vdm_type_support (0x00 ,
1536- asyncdbus .Variant ('q' , 0xABCD ), 0x0001 )
1535+ await mctp .call_register_vdm_type_support (0x00 , v_type , 0x0001 )
15371536 assert str (ex .value ) == "VDM type already registered"
0 commit comments