From: Bastien Nocera <hadess@hadess.net>
To: Pauli Virtanen <pav@iki.fi>
Cc: linux-bluetooth <linux-bluetooth@vger.kernel.org>
Subject: Re: Integration testing for BlueZ
Date: Mon, 30 Mar 2026 17:03:46 +0200 [thread overview]
Message-ID: <600acd737462930466b32072e7d86c857ba35c93.camel@hadess.net> (raw)
In-Reply-To: <628CF193-5AAC-49F4-A7D0-D4417EC6B4D2@iki.fi>
On Mon, 2026-03-30 at 12:59 +0000, Pauli Virtanen wrote:
> > Do you still have a copy of the above file somewhere? I wanted to
> > finish porting them into my own integration tests which I'm hoping
> > to
> > add to the regression/unit tests that are usually run for every
> > commit/MR.
>
> https://github.com/pv/bluez/blob/func-test-v3/test/functional/test_bluetoothctl_vm.py
>
> and test_btmgmt_vm.py
>
> Although these don't currently contain much, but could be extended.
>
> FWIW I'd maybe consider using pytest also for Python regression &
> unit tests, at least if you can make them run without root.
>
> There's interesting bluetoothd mock dbus library by the bluez-alsa
> developer, which looks like it could be useful for bluetoothctl/etc
> utility testing
>
> <https://github.com/Samsung/bluezoo>
I'm pretty familiar with python-dbusmock which includes a bluetoothd
mock server which can be used as non-root:
https://github.com/martinpitt/python-dbusmock
It's used extensively in the gnome-bluetooth test suite:
https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/blob/master/tests/integration-test.py?ref_type=heads
along with its mock upower implementation.
bluezoo looks more like a complete replacement including some behaviour
when running certain commands. The python-dbusmock implementation is
voluntarily simpler.
The questions at the end of the day boils down to *what* we want to
test:
1) Just like the gnome-bluetooth test suite, we could only care for our
own code, bluetoothd and upower are mocked, no specific hardware or
permissions is required.
This usually requires tweaking the mock implementation to better match
the behaviour of the real thing.
2) As I've implemented in this integration test:
https://github.com/hadess/bluez/blob/wip/hadess/add-meson-ell-wrap/unit/integration-test.py
we test command-line tools against the real bluetoothd which we
compile, it requires either root (to run btvirt if needed, and run
bluetoothd), or a machine with a real/mocked hardware and bluetoothd
already running. Ideally, with root access, you're testing the
"integration" of the command-line tools and bluetoothd.
Do we want to run those against a mocked bluetoothd that could get out
of sync with reality?
This wouldn't allow us to test bluetoothd itself as I've done in one
test, but maybe that's good to allow us to run those tests in more
circumstances?
My goal was being able to run "meson test" on my local development
machine without worrying about a layer of possibly outdated mocking
code.
I'd be fine running those tests that could be against a mocked
bluetoothd, if that means more tests being run.
I'd expect both those first options to be run for every merge request
or patch set, possibly even for every commit if we run into errors.
3) We have your variant of the test suite that does what 2) does but
with many more moving parts, and pretty high requirements in terms of
setup (and possibly resources). The only thing that's mocked is the
Bluetooth adapters, and not even for all tests.
In short, I think I might, before sending a patch out, re-focus the
basic tools tests to run against a mocked dbusmock bluez, so they
always run, whatever the environment.
Next, we can try to figure out whether some tests like the bluetoothd
startup warning one can be shared between the "run on every merge
request" (option 2) vs. "run once a week or once a day" heavier duty
tests (option 3).
next prev parent reply other threads:[~2026-03-30 15:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 2:32 [PATCH BlueZ 0/2] shared: recover from failed input initialization Ronan Pigott
2026-02-18 2:32 ` [PATCH BlueZ 1/2] zsh: amend completions Ronan Pigott
2026-02-18 3:37 ` shared: recover from failed input initialization bluez.test.bot
2026-02-18 14:56 ` [PATCH BlueZ 1/2] zsh: amend completions Luiz Augusto von Dentz
2026-02-18 2:33 ` [PATCH BlueZ 2/2] shared/shell: gracefully recover from failed input initialization Ronan Pigott
2026-02-18 14:58 ` Luiz Augusto von Dentz
2026-02-18 17:45 ` Ronan Pigott
2026-02-18 18:45 ` Luiz Augusto von Dentz
2026-02-25 16:01 ` Bastien Nocera
2026-02-25 18:58 ` Integration testing for BlueZ Pauli Virtanen
2026-02-27 11:37 ` Bastien Nocera
2026-03-30 12:38 ` Bastien Nocera
2026-03-30 12:59 ` Pauli Virtanen
2026-03-30 15:03 ` Bastien Nocera [this message]
2026-04-05 12:37 ` Pauli Virtanen
2026-02-27 11:31 ` [PATCH BlueZ 2/2] shared/shell: gracefully recover from failed input initialization Bastien Nocera
2026-02-28 17:32 ` Ronan Pigott
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=600acd737462930466b32072e7d86c857ba35c93.camel@hadess.net \
--to=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
--cc=pav@iki.fi \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox