Skip to content

Run the testers under User Mode Linux with time travel

Luiz Augusto von Dentz linux-bluetooth 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest27 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/27tools/test-runner: Do not report filesystems already mountedtools/test-runner.c+4 -12 replies
2/27shared/tester: Time out teardownsrc/shared/tester.c+62 -40 replies
3/27mgmt-tester: Wait for LL Privacy setup to completetools/mgmt-tester.c+190 -110 replies
4/27iso-tester: Fix leaking socket watchestools/iso-tester.c+16 -20 replies
5/27l2cap-tester: Fix race in LE Client - Close socket 2tools/l2cap-tester.c+13 -10 replies
6/27iso-tester: Fix busy waiting in PAST teststools/iso-tester.c+22 -30 replies
7/27doc: Enable IPv6 in tester.configdoc/tester.config+1 -00 replies
8/276lowpan-tester: Find the interface of the controllertools/6lowpan-tester.c+61 -10 replies
9/27emulator: Remove -T option from btvirtemulator/main.c+1 -20 replies
10/27doc: Add btvirt documentationMakefile.am doc/btvirt.rst+154 -00 replies
11/27emulator: Add vhost-user backendMakefile.tools emulator/vhost.c emulator/vhost.h+1087 -10 replies
12/27emulator: Add vhost-user virtio server to btvirtMakefile.tools doc/btvirt.rst emulator/main.c +2 more+391 -80 replies
13/27emulator: Add time travel calendar to btvirtMakefile.tools doc/btvirt.rst emulator/main.c +4 more+981 -50 replies
14/27emulator: Add virtio console and time travel client to btvirtMakefile.tools emulator/main.c emulator/ttclient.c +3 more+1158 -30 replies
15/27tools/test-runner: Add User Mode Linux supportdoc/test-runner.rst tools/test-runner.c+431 -140 replies
16/27doc: Add virtio documentationMakefile.am doc/virtio.rst+407 -00 replies
17/27shared/mainloop: Add idle callbackssrc/shared/mainloop-ell.c src/shared/mainloop-glib.c src/shared/mainloop.c +1 more+169 -10 replies
18/27shared/timeout: Run timeouts of 0 once idlesrc/shared/timeout-glib.c src/shared/timeout-mainloop.c+17 -20 replies
19/27shared/tester: Remove GLib dependencyMakefile.am src/shared/tester.c+156 -970 replies
20/27emulator/hciemu: Remove GLib dependencyemulator/hciemu.c+45 -770 replies
21/27tools: Build testers that do not need GLib with the mainloopMakefile.tools tools/bnep-tester.c tools/ioctl-tester.c +5 more+27 -430 replies
22/27shared/mainloop: Add deferred callbackssrc/shared/mainloop-ell.c src/shared/mainloop-glib.c src/shared/mainloop.c +1 more+45 -100 replies
23/27tools: Add socket watches for testers without GLibtools/tester-io.c tools/tester-io.h+452 -00 replies
24/27tools: Run sco-tester, rfcomm-tester and 6lowpan-tester on the mainloopMakefile.tools tools/6lowpan-tester.c tools/rfcomm-tester.c +1 more+148 -1310 replies
25/27tools: Run l2cap-tester and iso-tester on the mainloopMakefile.tools tools/iso-tester.c tools/l2cap-tester.c+355 -3250 replies
26/27doc/virtio: Update measurements of the testersdoc/virtio.rst+14 -80 replies
27/27doc: Split tester.config for QEMU and User Mode Linuxdoc/test-functional.rst doc/test-runner.rst doc/tester.config +2 more+370 -1350 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/27] Run the testers under User Mode Linux with time travel

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

This makes test-runner run the kernel testers in a User Mode Linux guest as well as with QEMU/KVM, and with -T on a simulated clock: btvirt is the guest's time travel calendar, so timers and timeouts take no real time and timing is the same on every run. btvirt can also serve controllers to UML guests as vhost-user virtio devices sharing the calendar, e.g. for firmware simulators.

Time travel made test races and busy loops visible, fixed first in the series, and showed that GLib's main loop reads the clock for every source on every iteration, a system call through the host under UML, so the testers now run on the mainloop instead.

Wall clock time in seconds, same kernel version and machine, all tests passing, single runs:

tester tests KVM UML UML -T UML -T
(GLib) (mainloop)

  mgmt-tester         514   78.2   94.0     42.6    20.3
  l2cap-tester        111    9.2   10.2     10.2     5.6
  iso-tester          141    8.1   11.7     16.3     7.6
  sco-tester           30    4.6    3.1      3.6     2.0
  rfcomm-tester        11    3.6    1.5      2.6     1.5
  smp-tester            8    3.6    1.5      1.5     1.0
  ioctl-tester         28    4.1    2.1      3.1     1.5
  userchan-tester       4    2.6    1.0      1.5     1.0
  bnep-tester           1    2.6    1.0      1.0     1.0

doc/tester.config is split into tester.kvm.config and tester.uml.config, both building every Bluetooth driver, so a single UML kernel can verify the drivers and run the testers.

Usage, with a UML kernel built from doc/tester.uml.config:

tools/test-runner -T -k <linux>/linux -- tools/mgmt-tester

Luiz Augusto von Dentz (27):
tools/test-runner: Do not report filesystems already mounted shared/tester: Time out teardown
mgmt-tester: Wait for LL Privacy setup to complete
iso-tester: Fix leaking socket watches
l2cap-tester: Fix race in LE Client - Close socket 2
iso-tester: Fix busy waiting in PAST tests
doc: Enable IPv6 in tester.config
6lowpan-tester: Find the interface of the controller
emulator: Remove -T option from btvirt
doc: Add btvirt documentation
emulator: Add vhost-user backend
emulator: Add vhost-user virtio server to btvirt
emulator: Add time travel calendar to btvirt
emulator: Add virtio console and time travel client to btvirt tools/test-runner: Add User Mode Linux support
doc: Add virtio documentation
shared/mainloop: Add idle callbacks
shared/timeout: Run timeouts of 0 once idle shared/tester: Remove GLib dependency emulator/hciemu: Remove GLib dependency
tools: Build testers that do not need GLib with the mainloop shared/mainloop: Add deferred callbacks
tools: Add socket watches for testers without GLib
tools: Run sco-tester, rfcomm-tester and 6lowpan-tester on the
mainloop
tools: Run l2cap-tester and iso-tester on the mainloop doc/virtio: Update measurements of the testers
doc: Split tester.config for QEMU and User Mode Linux

 Makefile.am                   |    5 +-
 Makefile.tools                |   47 +-
 doc/btvirt.rst                |  189 ++++++
 doc/test-functional.rst       |    4 +-
 doc/test-runner.rst           |  150 ++++-
 doc/tester.config             |  118 +---
 doc/tester.kvm.config         |  144 +++++
 doc/tester.uml.config         |  120 ++++
 doc/virtio.rst                |  412 +++++++++++++
 emulator/hciemu.c             |  122 ++--
 emulator/main.c               |  116 +++-
 emulator/timeout.c            |  102 ++++
 emulator/timetravel.c         |  743 ++++++++++++++++++++++++
 emulator/timetravel.h         |   55 ++
 emulator/ttclient.c           |  313 ++++++++++
 emulator/ttclient.h           |   50 ++
 emulator/vconsole.c           |  701 +++++++++++++++++++++++
 emulator/vconsole.h           |   26 +
 emulator/vhost.c              | 1018 +++++++++++++++++++++++++++++++++
 emulator/vhost.h              |   67 +++
 emulator/virtio.c             |  356 ++++++++++++
 emulator/virtio.h             |   20 +
 src/shared/mainloop-ell.c     |   12 +
 src/shared/mainloop-glib.c    |   12 +
 src/shared/mainloop.c         |  177 +++++-
 src/shared/mainloop.h         |    4 +
 src/shared/tester.c           |  306 +++++++---
 src/shared/timeout-glib.c     |   10 +-
 src/shared/timeout-mainloop.c |    9 +-
 tools/6lowpan-tester.c        |  111 +++-
 tools/bnep-tester.c           |    7 -
 tools/ioctl-tester.c          |    6 +-
 tools/iso-tester.c            |  358 +++++++-----
 tools/l2cap-tester.c          |  347 +++++------
 tools/mesh-tester.c           |    1 -
 tools/mgmt-tester.c           |  204 ++++++-
 tools/rfcomm-tester.c         |  105 ++--
 tools/sco-tester.c            |  108 ++--
 tools/smp-tester.c            |   30 +-
 tools/test-runner.c           |  404 ++++++++++++-
 tools/tester-io.c             |  400 +++++++++++++
 tools/tester-io.h             |   52 ++
 tools/tester.h                |    8 +-
 tools/userchan-tester.c       |    1 -
 44 files changed, 6721 insertions(+), 829 deletions(-)
 create mode 100644 doc/btvirt.rst
 mode change 100644 => 120000 doc/tester.config
 create mode 100644 doc/tester.kvm.config
 create mode 100644 doc/tester.uml.config
 create mode 100644 doc/virtio.rst
 create mode 100644 emulator/timeout.c
 create mode 100644 emulator/timetravel.c
 create mode 100644 emulator/timetravel.h
 create mode 100644 emulator/ttclient.c
 create mode 100644 emulator/ttclient.h
 create mode 100644 emulator/vconsole.c
 create mode 100644 emulator/vconsole.h
 create mode 100644 emulator/vhost.c
 create mode 100644 emulator/vhost.h
 create mode 100644 emulator/virtio.c
 create mode 100644 emulator/virtio.h
 create mode 100644 tools/tester-io.c
 create mode 100644 tools/tester-io.h
Signature · 1 line
2.56.0