Skip to content

Run test-functional under User Mode Linux

Luiz Augusto von Dentz linux-bluetooth 1 version Applied

Status from this message: This series was applied to bluetooth/bluez.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/10tools/test-runner: Default to time travel with User Mode Linuxdoc/test-runner.rst tools/test-runner.c+38 -181 reply
2/10tools/test-runner: Unbind virtio devices before powering off UMLtools/test-runner.c+38 -10 replies
3/10emulator: Answer the time of a guest with a skewemulator/timetravel.c+7 -10 replies
4/10adapter: Don't return Busy when a pending change sets the same valuesrc/adapter.c+77 -41 reply
5/10test: functional: wait for BAP transports to be configuredtest/functional/test_bap.py+14 -80 replies
6/10shared/mcp: Don't drop commands before supported opcodes are readprofiles/audio/mcp.c src/shared/mcp.c+12 -60 replies
7/10doc/test-functional: Document User Mode Linux VM hostsdoc/test-functional.rst+70 -40 replies
8/10a2dp: Fix refusing the AVDTP connection of a new linkprofiles/audio/a2dp.c profiles/audio/avdtp.c profiles/audio/avdtp.h+32 -00 replies
9/10adapter: Don't cancel requests of a new link on stale disconnectionsrc/adapter.c+40 -20 replies
10/10test: Cover A2DP reconnection with a pending disconnectiondoc/functional-a2dp.rst test/functional/test_a2dp.py+68 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH BlueZ v1 00/10] Run test-functional under User Mode Linux

From: Luiz Augusto von Dentz <[email protected]>

This allows running test-functional with User Mode Linux (UML) VM hosts, e.g. on machines without KVM support, together with pytest-bluezenv:

https://github.com/bluez/pytest-bluezenv/pull/8

test-runner runs UML guests on time travel by default, as the kernel testers benefit from it, with -R to run on real time, which is what test-functional uses: with traffic between several guests, lock-step makes the tests slower, see the measurements in the documentation.

The slower timing of UML exposed races, which are fixed by:

- adapter: setting Pairable right after an agent registered failed with Busy while bondable was being set by bluetoothd itself. This is fixed in bluetoothd, replying once the pending change completes when it sets the requested value, rather than retrying in the tests.
- test_bap: transports were acquired or selected before bluetoothctl had them configured on its endpoint.
- shared/mcp: commands sent before the Media Control Point Opcodes Supported was read were dropped while the D-Bus call succeeded.
- a2dp, adapter: when the remote reconnects before the disconnection of the previous link is processed, the new AVDTP connection was taken for a transport channel of the stale session and refused, or its service authorization was cancelled by the stale disconnection. A new test reproduces it by stopping bluetoothd across the reconnection.

With these, make check-functional with 4 workers takes about 100-140 s under UML (68 s with KVM on the same machine). Remaining intermittent failures under UML:

- test_bass_past_*_transport_acquire, addressed by the pending "bass:
wait for PAST listener readiness".
- test_hog[sci], reading the HID SCI Information characteristic returns 00, not investigated yet.

Luiz Augusto von Dentz (10):
tools/test-runner: Default to time travel with User Mode Linux tools/test-runner: Unbind virtio devices before powering off UML
emulator: Answer the time of a guest with a skew
adapter: Don't return Busy when a pending change sets the same value
test: functional: wait for BAP transports to be configured shared/mcp: Don't drop commands before supported opcodes are read doc/test-functional: Document User Mode Linux VM hosts
a2dp: Fix refusing the AVDTP connection of a new link
adapter: Don't cancel requests of a new link on stale disconnection
test: Cover A2DP reconnection with a pending disconnection

 doc/functional-a2dp.rst      |  32 +++++++++
 doc/test-functional.rst      |  74 +++++++++++++++++++--
 doc/test-runner.rst          |  23 ++++---
 emulator/timetravel.c        |   8 ++-
 profiles/audio/a2dp.c        |   7 ++
 profiles/audio/avdtp.c       |  24 +++++++
 profiles/audio/avdtp.h       |   1 +
 profiles/audio/mcp.c         |  10 +--
 src/adapter.c                | 123 +++++++++++++++++++++++++++++++++--
 src/shared/mcp.c             |   8 ++-
 test/functional/test_a2dp.py |  36 ++++++++++
 test/functional/test_bap.py  |  22 ++++---
 tools/test-runner.c          |  72 +++++++++++++++++---
 13 files changed, 396 insertions(+), 44 deletions(-)
Signature · 1 line
2.56.0