Skip to content

Commit 91f19de

Browse files
lylezhu2012nashif
authored andcommitted
tests: Bluetooth: Classic: rfcomm_s: Check connect event before send
Sometimes, the command `rfcomm_s send 9 1` will fail to execute due to the DLC has not been established. Check the DLC connected event before sending shell command `rfcomm_s send 9 1`. Signed-off-by: Lyle Zhu <[email protected]>
1 parent 9538b4f commit 91f19de

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/bluetooth/classic/rfcomm_s/pytest/test_rfcomm_s.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,18 @@ async def tc_rfcomm_s_4(hci_port, shell, dut, address, snoop_file) -> None:
502502
dlc_7 = await establish_dlc(rfcomm_mux, channel_7)
503503
assert dlc_9 and dlc_7, "Failed to establish DLC"
504504

505+
found, lines = await _wait_for_shell_response(dut, "connected")
506+
assert found is True
507+
508+
connected_count = 0
509+
for line in lines:
510+
if "connected" in line:
511+
connected_count += 1
512+
513+
if connected_count < 2:
514+
found, _ = await _wait_for_shell_response(dut, "connected")
515+
assert found is True
516+
505517
logger.info('Step 3: Transfer data')
506518
await send_cmd_to_iut(shell, dut, "rfcomm_s send 9 1")
507519
assert await wait_mux_response(logger_capture, 'Data send pass'), (

0 commit comments

Comments
 (0)