Linux bluetooth development
 help / color / mirror / Atom feed
From: Pauli Virtanen <noreply@github.com>
To: linux-bluetooth@vger.kernel.org
Subject: [bluez/bluez] 57ef69: emulator: btvirt: check pkt lengths, don't get stu...
Date: Wed, 13 May 2026 10:28:30 -0700	[thread overview]
Message-ID: <bluez/bluez/push/refs/heads/1094320/000000-d2d058@github.com> (raw)

  Branch: refs/heads/1094320
  Home:   https://github.com/bluez/bluez
  Commit: 57ef69b7882151f5e6d94e9be8e3902277f81c80
      https://github.com/bluez/bluez/commit/57ef69b7882151f5e6d94e9be8e3902277f81c80
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M emulator/server.c

  Log Message:
  -----------
  emulator: btvirt: check pkt lengths, don't get stuck on malformed

Don't try to parse packet before whole header is received.

If received data has unknown packet type, reset buffer so that we don't
get stuck.


  Commit: 639f99a94734bcc1eb812a8d9dbf4e776017287e
      https://github.com/bluez/bluez/commit/639f99a94734bcc1eb812a8d9dbf4e776017287e
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M emulator/main.c

  Log Message:
  -----------
  emulator: btvirt: allow specifying where server unix sockets are made

Make --server to take optional path name where to create the various
server sockets.


  Commit: ad264c862239892f0d9965b0b679ae36c88b5777
      https://github.com/bluez/bluez/commit/ad264c862239892f0d9965b0b679ae36c88b5777
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M emulator/server.c

  Log Message:
  -----------
  emulator: btvirt: support SCO data packets

Support also SCO data packets in btvirt.


  Commit: 2bf4030bb151631b24a425a82bddc8f3b2649595
      https://github.com/bluez/bluez/commit/2bf4030bb151631b24a425a82bddc8f3b2649595
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M emulator/btdev.c

  Log Message:
  -----------
  emulator: btdev: clear more state on Reset

On controller Reset command, initialize most fields in struct btdev to
zero, similarly to the state just after btdev_create().

This excludes some fields like command bitmasks, which hciemu may have
adjusted.

To make this easier, add struct_group() macro similar to what kernel
uses.


  Commit: cf32208ed16e44e89474f4faa67293261641b208
      https://github.com/bluez/bluez/commit/cf32208ed16e44e89474f4faa67293261641b208
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M tools/test-runner.c

  Log Message:
  -----------
  test-runner: enable path argument for --unix

Allow specifying the path for the controller socket to be used.


  Commit: eef206c5e2f6291febea934eeb08d20ec3ff02b3
      https://github.com/bluez/bluez/commit/eef206c5e2f6291febea934eeb08d20ec3ff02b3
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M tools/test-runner.c

  Log Message:
  -----------
  test-runner: Add -o/--option option

Allow passing arbitrary arguments to QEMU.


  Commit: c0775bb788bdabecc573224b3d218c5e8348a38b
      https://github.com/bluez/bluez/commit/c0775bb788bdabecc573224b3d218c5e8348a38b
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M tools/test-runner.c

  Log Message:
  -----------
  test-runner: allow source tree root for -k

Allow passing source tree root for -k option, look up kernel below it.


  Commit: f1e9b638a13c9893f4c29d6c958fbf5f9303f1cc
      https://github.com/bluez/bluez/commit/f1e9b638a13c9893f4c29d6c958fbf5f9303f1cc
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M tools/test-runner.c

  Log Message:
  -----------
  test-runner: use virtio-serial for implementing -u device forwarding

Using pci-serial to forward eg. btvirt sockets is unreliable, as qemu or
kernel seems to be sometimes dropping part of the sent data or insert
spurious \0 bytes, leading to sporadic errors like:

    kernel: Bluetooth: hci0: command 0x0c52 tx timeout
    kernel: Bluetooth: hci0: Opcode 0x0c52 failed: -110
    btvirt: packet error, unknown type: 0

This appears to occur most often when host system is under load, e.g.
due to multiple test-runners running at the same time.  The problem is
not specific to btvirt, but seems to be in the qemu serial device layer
vs. kernel interaction.

Change test-runner to use virtserialport to forward the btvirt
connection inside the VM, as virtio-serial doesn't appear to have these
problems.


  Commit: a7947e84803d743fdb53948964f71ed312da4038
      https://github.com/bluez/bluez/commit/a7947e84803d743fdb53948964f71ed312da4038
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M doc/ci.config
    M doc/test-runner.rst
    M doc/tester.config

  Log Message:
  -----------
  doc: enable CONFIG_VIRTIO_CONSOLE in tester config

Enable kernel option that allows using -device virtserialport in qemu.
This is easier to make work reliably than pci-serial channel.


  Commit: 24d0b8f8ec6b7c4f0a52b004bbf94063cda40af5
      https://github.com/bluez/bluez/commit/24d0b8f8ec6b7c4f0a52b004bbf94063cda40af5
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M doc/ci.config
    M doc/test-runner.rst
    M doc/tester.config

  Log Message:
  -----------
  doc: enable KVM paravirtualization & clock support in tester kernel config

Enable KVM guest and PTP options in tester kernel config.

This allows synchronizing tester VM guest with host clock, needed for
testers that want to compare timestamps outside the VM guest.


  Commit: f106db3fc469d7a7e12997b0ec588b3090c21a03
      https://github.com/bluez/bluez/commit/f106db3fc469d7a7e12997b0ec588b3090c21a03
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    A doc/test-functional.rst

  Log Message:
  -----------
  doc: add functional/integration testing documentation

Add documentation for functional/integration test suite.


  Commit: 79314e1cd2bb69b5cb9178754bec2136e6bd3f8c
      https://github.com/bluez/bluez/commit/79314e1cd2bb69b5cb9178754bec2136e6bd3f8c
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    A test/functional/__init__.py
    A test/functional/conftest.py
    A test/functional/requirements.txt
    A test/functional/test_bluetoothctl_vm.py
    A test/functional/test_btmgmt_vm.py
    A test/pytest.ini
    A test/test-functional
    A test/test-functional-attach

  Log Message:
  -----------
  test: add functional/integration testing framework

Add framework for writing tests simulating "real" environments where
BlueZ and other parts of the stack run on different virtual machine
hosts that communicate with each other.

Add some smoke tests for bluetoothctl and btmgmt.

The implementation for the VM setup is maintained separately in the
pytest-bluezenv plugin, https://pypi.org/project/pytest-bluezenv

Implements:

- RPC communication with tester instances running each of the VM hosts,
  so that tests can be written on the parent host which coordinates the
  execution.

- Extensible way to add stateful test-specific code inside the VM
  instances

- Logging control: output from different processes running inside the VM
  are separated and can be filtered.

- Test runner framework with Pytest, factored into a pytest plugin

- Grouping tests to minimize VM reboots

- Redirecting USB controllers to use for testing

There is no requirement that the tests spawn VM instances.


  Commit: c0146e6abc9005ce88f23c625aac786a83c51d8c
      https://github.com/bluez/bluez/commit/c0146e6abc9005ce88f23c625aac786a83c51d8c
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M Makefile.am
    M configure.ac

  Log Message:
  -----------
  build: add functional testing target

This adds check-functional: target that runs the functional test suite.

Also add a --enable-functional-testing=<kernel-image> argument for
configure that can be used to include it in the check: make target,
possibly with a predefined kernel image.


  Commit: e4b50e8d1946995bb2d9ff46a7d4183b19e08c78
      https://github.com/bluez/bluez/commit/e4b50e8d1946995bb2d9ff46a7d4183b19e08c78
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    A test/functional/test_tests.py

  Log Message:
  -----------
  test: functional: impose Python code formatting

Check Python code formatting of the functional test suite.


  Commit: ba02713d7ebd2af3419b22fc0b0b49b503ceb7fe
      https://github.com/bluez/bluez/commit/ba02713d7ebd2af3419b22fc0b0b49b503ceb7fe
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    A test/functional/test_agent.py

  Log Message:
  -----------
  test: functional: add some Agent1 interface tests

Add test

test/functional/test_agent.py::test_agent_pair_bredr


  Commit: d2d05811090238ea21fe52e00942c57d6b7546de
      https://github.com/bluez/bluez/commit/d2d05811090238ea21fe52e00942c57d6b7546de
  Author: Pauli Virtanen <pav@iki.fi>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    A test/functional/test_obex.py

  Log Message:
  -----------
  test: functional: add basic obex file transfer tests

Add tests for Obex DBus API and obexctl

test/functional/test_obex.py::test_obex_ftp_get
test/functional/test_obex.py::test_obex_ftp_list
test/functional/test_obex.py::test_obexctl_list


Compare: https://github.com/bluez/bluez/compare/57ef69b78821%5E...d2d058110902

To unsubscribe from these emails, change your notification settings at https://github.com/bluez/bluez/settings/notifications

                 reply	other threads:[~2026-05-13 17:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bluez/bluez/push/refs/heads/1094320/000000-d2d058@github.com \
    --to=noreply@github.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox