If the command complete opcode is not specified then it
will match ANY command complete event which can prove to
be troubles some when getting a series of CommandComplete()
matches.
Bug:
162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: Ia42c74c6476fd9d0763afa87ad1f61a243942e27
class HciMatchers(object):
@staticmethod
- def CommandComplete(opcode=None):
+ def CommandComplete(opcode):
return lambda msg: HciMatchers._is_matching_command_complete(msg.payload, opcode)
@staticmethod
self._enqueue_hci_command(
hci_packets.IoCapabilityRequestReplyBuilder(
dut_address.decode('utf8'), self._io_caps, oob_data_present, self._auth_reqs), True)
- assertThat(self._hci_event_stream).emits(HciMatchers.CommandComplete())
+ assertThat(self._hci_event_stream).emits(
+ HciMatchers.CommandComplete(hci_packets.OpCode.IO_CAPABILITY_REQUEST_REPLY))
logging.info("Cert: Waiting for SIMPLE_PAIRING_COMPLETE")
ssp_complete_capture = HciCaptures.SimplePairingCompleteCapture()
assertThat(self._hci_event_stream).emits(ssp_complete_capture)