Skip to content

Commit 97e571a

Browse files
committed
tests: Check that the control type does not trigger a VDM types query
We have a bug where the presence of the control type will trigger a VDM query, rather than 7e/7f. Explicitly clear the types set, to check for this case. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
1 parent 5805f5f commit 97e571a

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

tests/test_mctpd.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,37 @@ async def test_query_vdm_types(dbus, mctpd):
665665
assert set(vdm_types) == set(ret_vdm_types)
666666

667667

668+
async def test_query_vdm_types_no_control(dbus, mctpd):
669+
"""Test that we query VDM types if *only* a VDM type is reported in the
670+
non-vendor Message Type Support response
671+
"""
672+
iface = mctpd.system.interfaces[0]
673+
vdm_types = [
674+
VDMType(VDMType.TYPE_PCI, 0x1234, 0x5678),
675+
]
676+
# only include the VDM type
677+
ep = Endpoint(
678+
iface,
679+
bytes([0x1E]),
680+
eid=15,
681+
types=[VDMType.TYPE_PCI],
682+
vdm_msg_types=vdm_types,
683+
)
684+
mctpd.network.add_endpoint(ep)
685+
686+
mctp = await mctpd_mctp_iface_obj(dbus, iface)
687+
(eid, net, path, new) = await mctp.call_learn_endpoint(ep.lladdr)
688+
689+
assert eid == ep.eid
690+
691+
ep_obj = await mctpd_mctp_endpoint_common_obj(dbus, path)
692+
693+
# Query VendorDefinedMessageTypes property
694+
vdm_types = list(await ep_obj.get_vendor_defined_message_types())
695+
696+
assert len(vdm_types) == 1
697+
698+
668699
class InvalidVDMEndpointBase(Endpoint):
669700
async def handle_mctp_control(self, sock, addr, data):
670701
flags, opcode = data[0:2]

0 commit comments

Comments
 (0)