From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1 05/10] test: functional: wait for BAP transports to be configured
Date: Fri, 30 Oct 2026 17:29:34 -0400 [thread overview]
Message-ID: <20261030212940.753771-6-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20261030212940.753771-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
bluetoothctl only selects or acquires a transport its local endpoint was
configured with, which it learns from SetConfiguration, while the
transport object may be reported before. The tests acting on transports
could then fail with "transport endpoint not found" when the call came
later, as happens under User Mode Linux.
Wait for the transport reported under SetConfiguration in the tests
selecting or acquiring it.
Assisted-by: Claude:claude-opus-5-5
---
test/functional/test_bap.py | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/test/functional/test_bap.py b/test/functional/test_bap.py
index 7cd9466bd5f7..221efd982071 100644
--- a/test/functional/test_bap.py
+++ b/test/functional/test_bap.py
@@ -37,6 +37,11 @@ ControllerMode = le
TRANSPORT_RE = r"Transport (/org/bluez/\S+/fd\d+)"
+# A transport is reported once created, and indented under the endpoint
+# SetConfiguration call once its local endpoint is configured with it,
+# which bluetoothctl requires to select or acquire it
+CONFIGURED = "\t"
+
def dev_addr(host):
return host.bdaddr.upper().replace(":", "_")
@@ -259,14 +264,15 @@ def unicast_hosts(hosts):
yield host0, host1, initiator, acceptor
-def expect_transports(ctl):
+def expect_transports(ctl, configured=False):
"""
The endpoint is configured for stereo, so one stream per location is
created, each with its own CIS in the same CIG.
"""
- _, m = ctl.expect(r"Transport (/org/bluez/\S+/fd0)")
+ prefix = CONFIGURED if configured else ""
+ _, m = ctl.expect(prefix + r"Transport (/org/bluez/\S+/fd0)")
left = m[0].decode("utf-8")
- _, m = ctl.expect(r"Transport (/org/bluez/\S+/fd1)")
+ _, m = ctl.expect(prefix + r"Transport (/org/bluez/\S+/fd1)")
right = m[0].decode("utf-8")
return left, right
@@ -292,7 +298,7 @@ def test_bap_unicast_transport_created(unicast_hosts):
def test_bap_unicast_transport_acquire(unicast_hosts):
host0, host1, initiator, acceptor = unicast_hosts
- left, right = expect_transports(initiator)
+ left, right = expect_transports(initiator, configured=True)
# The CIS are only created once every CIS of the CIG is ready, so
# all the transports need to be acquired
@@ -627,7 +633,7 @@ def test_bap_broadcast_transport_created(hosts, source_script):
def test_bap_broadcast_transport_acquire(hosts, source_script):
source, sink = start_broadcast(hosts, source_script)
- _, m = sink.expect(TRANSPORT_RE)
+ _, m = sink.expect(CONFIGURED + TRANSPORT_RE)
transport = m[0].decode("utf-8")
# Selecting the transport syncs to the BIG and starts acquiring it
@@ -682,7 +688,7 @@ def expect_bis_transport(ctl, host, bis):
Transport a side created for the BIS carrying its own channel,
checking it is the only one it has.
"""
- _, m = ctl.expect(BIS_TRANSPORT.format(bis))
+ _, m = ctl.expect(CONFIGURED + BIS_TRANSPORT.format(bis))
transport = m[0].decode("utf-8")
# Checked over D-Bus rather than with transport.list, as the
@@ -942,8 +948,8 @@ def set_hosts(hosts, secure_connections):
"Pairing successful",
f"DeviceSet /org/bluez/hci0/{SET_PATH}",
f"Device {host2.bdaddr.upper()} Bonded: yes",
- TRANSPORT.format(dev_addr(host1)),
- TRANSPORT.format(dev_addr(host2)),
+ CONFIGURED + TRANSPORT.format(dev_addr(host1)),
+ CONFIGURED + TRANSPORT.format(dev_addr(host2)),
],
)
--
2.56.0
next prev parent reply other threads:[~2026-10-30 21:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 21:29 [PATCH BlueZ v1 00/10] Run test-functional under User Mode Linux Luiz Augusto von Dentz
2026-10-30 21:29 ` [PATCH BlueZ v1 01/10] tools/test-runner: Default to time travel with " Luiz Augusto von Dentz
2026-10-30 23:58 ` Run test-functional under " bluez.test.bot
2026-10-30 21:29 ` [PATCH BlueZ v1 02/10] tools/test-runner: Unbind virtio devices before powering off UML Luiz Augusto von Dentz
2026-10-30 21:29 ` [PATCH BlueZ v1 03/10] emulator: Answer the time of a guest with a skew Luiz Augusto von Dentz
2026-10-30 21:29 ` [PATCH BlueZ v1 04/10] adapter: Don't return Busy when a pending change sets the same value Luiz Augusto von Dentz
2026-10-30 21:34 ` Luiz Augusto von Dentz
2026-10-30 21:29 ` Luiz Augusto von Dentz [this message]
2026-10-30 21:29 ` [PATCH BlueZ v1 06/10] shared/mcp: Don't drop commands before supported opcodes are read Luiz Augusto von Dentz
2026-10-30 21:29 ` [PATCH BlueZ v1 07/10] doc/test-functional: Document User Mode Linux VM hosts Luiz Augusto von Dentz
2026-10-30 21:29 ` [PATCH BlueZ v1 08/10] a2dp: Fix refusing the AVDTP connection of a new link Luiz Augusto von Dentz
2026-10-30 21:29 ` [PATCH BlueZ v1 09/10] adapter: Don't cancel requests of a new link on stale disconnection Luiz Augusto von Dentz
2026-10-30 21:29 ` [PATCH BlueZ v1 10/10] test: Cover A2DP reconnection with a pending disconnection Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261030212940.753771-6-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.