Skip to content

Qtest driver framework

Emanuele Giuseppe Esposito qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest34 patches 36 repliesIn review
  2. v17 patches 31 repliesSuperseded

Changes in v2 from the cover letter

- added command line arguments caching
- converted all virtio tests
- converted e1000e test
- added two more machines (virt and ppc64)
- introduced separation between edge-name (used by get_driver) and node-name (matched with QMP query result)
- edge carries also additional arguments, like the pci address of destination device
- test now can execute a function before and after the command line is allocated, to allocate various file and sockets needed by command line and test
- better documentation with working example in qgraph.h
- removed esplicit creation of interfaces

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/34tests: qgraph API for the qtest driver frameworkconfigure include/qemu/module.h tests/Makefile.include +5 more+2437 -30 replies
2/34tests/qgraph: rename qpci_init_pc functionstests/e1000e-test.c tests/i440fx-test.c tests/ide-test.c +10 more+21 -141 reply
3/34tests/qgraph: pci-pc driver and interface nodestests/Makefile.include tests/libqos/pci-pc.c tests/libqos/pci-pc.h +2 more+110 -135 replies
4/34tests/qgraph: x86_64/pc machine nodetests/Makefile.include tests/libqos/x86_64_pc-machine.c+113 -03 replies
5/34tests/qgraph: sdhci driver and interface nodestests/Makefile.include tests/libqos/sdhci.c tests/libqos/sdhci.h+233 -06 replies
6/34tests/qgraph: sdhci test nodetests/Makefile.include tests/sdhci-test.c+68 -1631 reply
7/34tests/qgraph: arm/raspi2 machine nodetests/Makefile.include tests/libqos/raspi2-machine.c+83 -01 reply
8/34tests/qgraph: rename qpci_init_spapr functionstests/libqos/libqos-spapr.c tests/libqos/pci-spapr.c tests/libqos/pci-spapr.h+3 -31 reply
9/34tests/qgraph: pci-spapr driver and interface nodestests/Makefile.include tests/libqos/pci-spapr.c tests/libqos/pci-spapr.h+59 -244 replies
10/34tests/qgraph: ppc64/pseries machine nodetests/Makefile.include tests/libqos/ppc64_pseries-machine.c+112 -00 replies
11/34test/qgraph: e1000e driver and interface nodestests/Makefile.include tests/libqos/e1000e.c tests/libqos/e1000e.h+316 -00 replies
12/34test/qgraph: e1000e-test nodetests/Makefile.include tests/e1000e-test.c+78 -2790 replies
13/34test/qgraph: virtio_start_device functiontests/libqos/virtio.c tests/libqos/virtio.h tests/vhost-user-test.c +4 more+15 -332 replies
14/34test/qgraph: virtio-pci driver and interface nodestests/Makefile.include tests/libqos/virtio-pci.c tests/libqos/virtio-pci.h+77 -171 reply
15/34tests/qgraph: rename qvirtio_mmio_init_device functionstests/libqos/virtio-mmio.c tests/libqos/virtio-mmio.h tests/virtio-blk-test.c+3 -31 reply
16/34test/qgraph: virtio-mmio driver and interface nodestests/libqos/virtio-mmio.c tests/libqos/virtio-mmio.h+56 -181 reply
17/34test/qgraph: arm/virt machine nodetests/Makefile.include tests/libqos/virt-machine.c+91 -00 replies
18/34tests: virtio: separate ccw tests from libqostests/Makefile.include tests/virtio-ccw-test.c+123 -31 reply
19/34test/qgraph: virtio-serial driver and interface nodestests/Makefile.include tests/libqos/virtio-serial.c tests/libqos/virtio-serial.h+151 -00 replies
20/34test/qgraph: virtio-console test nodetests/Makefile.include tests/libqos/virtio.c tests/virtio-console-test.c+19 -170 replies
21/34test/qgraph: virtio-serial test nodetests/Makefile.include tests/virtio-serial-test.c+10 -210 replies
22/34test/qgraph: virtio-9p driver and interface nodestests/Makefile.include tests/libqos/virtio-9p.c tests/libqos/virtio-9p.h+207 -00 replies
23/34test/qgraph: virtio-9p test nodetests/Makefile.include tests/virtio-9p-test.c+82 -1380 replies
24/34test/qgraph: virtio-balloon driver and interface nodestests/Makefile.include tests/libqos/virtio-balloon.c tests/libqos/virtio-balloon.h+151 -00 replies
25/34test/qgraph: virtio-balloon test nodetests/Makefile.include tests/virtio-balloon-test.c+8 -180 replies
26/34test/qgraph: virtio-rng driver and interface nodestests/Makefile.include tests/libqos/virtio-rng.c tests/libqos/virtio-rng.h+148 -00 replies
27/34test/qgraph: virtio-rng test nodetests/Makefile.include tests/virtio-rng-test.c+10 -180 replies
28/34test/qgraph: virtio-blk driver and interface nodestests/Makefile.include tests/libqos/virtio-blk.c tests/libqos/virtio-blk.h+167 -00 replies
29/34test/qgraph: virtio-blk test nodetests/Makefile.include tests/virtio-blk-test.c+186 -2773 replies
30/34test/qgraph: virtio-net driver and interface nodestests/Makefile.include tests/libqos/virtio-net.c tests/libqos/virtio-net.h+219 -00 replies
31/34test/qgraph: virtio-net test nodetests/Makefile.include tests/virtio-net-test.c+49 -1130 replies
32/34test/qgraph: virtio-scsi driver and interface nodestests/Makefile.include tests/libqos/virtio-scsi.c tests/libqos/virtio-scsi.h+157 -00 replies
33/34test/qgraph: virtio-scsi test nodetests/Makefile.include tests/virtio-scsi-test.c+75 -810 replies
34/34test/qgraph: temporarly commented vhost-user-testtests/Makefile.include+4 -40 replies

Reviews trailers per patch

2 of 34 patches have a Reviewed-by or Acked-by.

PatchLaurent Vivier
1/34
2/34
3/34
4/34
5/34
6/34R-b
7/34
8/34
9/34
10/34
11/34
12/34
13/34
14/34
15/34
16/34R-b
17/34
18/34
19/34
20/34
21/34
22/34
23/34
24/34
25/34
26/34
27/34
28/34
29/34
30/34
31/34
32/34
33/34
34/34

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/34] Qtest driver framework

qgraph API for the qtest driver framework

This series of patches introduce a different qtest driver organization, viewing machines, drivers and tests as node in a graph, each having one or multiple edges relations.

The idea is to have a framework where each test asks for a specific driver, and the framework takes care of allocating the proper devices required and passing the correct command line arguments to QEMU.

A node can be of four types:
- MACHINE: for example "arm/raspi2"
- DRIVER: for example "generic-sdhci"
- INTERFACE: for example "sdhci" (interface for all "-sdhci" drivers)
- TEST: for example "sdhci-test", consumes an interface and tests
the functions provided

An edge relation between two nodes (drivers or machines) X and Y can be:
- X CONSUMES Y: Y can be plugged into X
- X PRODUCES Y: X provides the interface Y
- X CONTAINS Y: Y is part of X component

Basic framework steps are the following:
- All nodes and edges are created in their respective machine/driver/test files
- The framework starts QEMU and asks for a list of available devices and machines
- The framework walks the graph starting from the available machines and performs a Depth First Search for tests
- Once a test is found, the path is walked again and all drivers are allocated accordingly and the final interface is passed to the test
- The test is executed
- Unused objects are cleaned and the path discovery is continued

Depending on the QEMU binary used, only some drivers/machines will be available and only test that are reached by them will be executed.

This work is being done as Google Summer of Code 2018 project for QEMU, my mentors are Paolo Bonzini and Laurent Vivier.
Additional infos on the project can be found at:
https://wiki.qemu.org/Features/qtest_driver_framework

v2:
- added command line arguments caching
- converted all virtio tests
- converted e1000e test
- added two more machines (virt and ppc64)
- introduced separation between edge-name (used by get_driver) and node-name (matched with QMP query result)
- edge carries also additional arguments, like the pci address of destination device
- test now can execute a function before and after the command line is allocated, to allocate various file and sockets needed by command line and test
- better documentation with working example in qgraph.h
- removed esplicit creation of interfaces

Emanuele Giuseppe Esposito (33):
tests: qgraph API for the qtest driver framework tests/qgraph: rename qpci_init_pc functions tests/qgraph: pci-pc driver and interface nodes tests/qgraph: x86_64/pc machine node tests/qgraph: sdhci driver and interface nodes tests/qgraph: sdhci test node
tests/qgraph: arm/raspi2 machine node tests/qgraph: rename qpci_init_spapr functions tests/qgraph: pci-spapr driver and interface nodes tests/qgraph: ppc64/pseries machine node test/qgraph: e1000e driver and interface nodes test/qgraph: e1000e-test node
test/qgraph: virtio_start_device function test/qgraph: virtio-pci driver and interface nodes tests/qgraph: rename qvirtio_mmio_init_device functions test/qgraph: virtio-mmio driver and interface nodes test/qgraph: arm/virt machine node test/qgraph: virtio-serial driver and interface nodes test/qgraph: virtio-console test node test/qgraph: virtio-serial test node test/qgraph: virtio-9p driver and interface nodes test/qgraph: virtio-9p test node
test/qgraph: virtio-balloon driver and interface nodes test/qgraph: virtio-balloon test node test/qgraph: virtio-rng driver and interface nodes test/qgraph: virtio-rng test node
test/qgraph: virtio-blk driver and interface nodes test/qgraph: virtio-blk test node
test/qgraph: virtio-net driver and interface nodes test/qgraph: virtio-net test node
test/qgraph: virtio-scsi driver and interface nodes test/qgraph: virtio-scsi test node test/qgraph: temporarly commented vhost-user-test

Paolo Bonzini (1):
tests: virtio: separate ccw tests from libqos

 configure                            |   2 +-
 include/qemu/module.h                |   2 +
 tests/Makefile.include               |  79 +--
 tests/e1000e-test.c                  | 354 +++----------
 tests/i440fx-test.c                  |   2 +-
 tests/ide-test.c                     |   2 +-
 tests/libqos/ahci.c                  |   2 +-
 tests/libqos/e1000e.c                | 262 ++++++++++
 tests/libqos/e1000e.h                |  53 ++
 tests/libqos/libqos-pc.c             |   2 +-
 tests/libqos/libqos-spapr.c          |   2 +-
 tests/libqos/pci-pc.c                |  41 +-
 tests/libqos/pci-pc.h                |  22 +-
 tests/libqos/pci-spapr.c             |  57 ++-
 tests/libqos/pci-spapr.h             |  26 +-
 tests/libqos/pci.c                   |  48 +-
 tests/libqos/pci.h                   |  15 +
 tests/libqos/ppc64_pseries-machine.c | 111 +++++
 tests/libqos/qgraph.c                | 721 +++++++++++++++++++++++++++
 tests/libqos/qgraph.h                | 514 +++++++++++++++++++
 tests/libqos/qgraph_extra.h          | 263 ++++++++++
 tests/libqos/raspi2-machine.c        |  82 +++
 tests/libqos/sdhci.c                 | 163 ++++++
 tests/libqos/sdhci.h                 |  69 +++
 tests/libqos/virt-machine.c          |  90 ++++
 tests/libqos/virtio-9p.c             | 164 ++++++
 tests/libqos/virtio-9p.h             |  42 ++
 tests/libqos/virtio-balloon.c        | 111 +++++
 tests/libqos/virtio-balloon.h        |  39 ++
 tests/libqos/virtio-blk.c            | 126 +++++
 tests/libqos/virtio-blk.h            |  40 ++
 tests/libqos/virtio-mmio.c           |  72 ++-
 tests/libqos/virtio-mmio.h           |   6 +-
 tests/libqos/virtio-net.c            | 177 +++++++
 tests/libqos/virtio-net.h            |  41 ++
 tests/libqos/virtio-pci.c            |  80 ++-
 tests/libqos/virtio-pci.h            |  12 +
 tests/libqos/virtio-rng.c            | 108 ++++
 tests/libqos/virtio-rng.h            |  39 ++
 tests/libqos/virtio-scsi.c           | 117 +++++
 tests/libqos/virtio-scsi.h           |  39 ++
 tests/libqos/virtio-serial.c         | 109 ++++
 tests/libqos/virtio-serial.h         |  39 ++
 tests/libqos/virtio.c                |   9 +
 tests/libqos/virtio.h                |   1 +
 tests/libqos/x86_64_pc-machine.c     | 110 ++++
 tests/q35-test.c                     |   4 +-
 tests/qos-test.c                     | 480 ++++++++++++++++++
 tests/rtl8139-test.c                 |   2 +-
 tests/sdhci-test.c                   | 222 +++------
 tests/tco-test.c                     |   2 +-
 tests/test-qgraph.c                  | 446 +++++++++++++++++
 tests/usb-hcd-ehci-test.c            |   2 +-
 tests/vhost-user-test.c              |   7 +-
 tests/virtio-9p-test.c               | 221 +++-----
 tests/virtio-balloon-test.c          |  22 +-
 tests/virtio-blk-test.c              | 473 +++++++-----------
 tests/virtio-ccw-test.c              | 121 +++++
 tests/virtio-console-test.c          |  30 +-
 tests/virtio-net-test.c              | 163 ++----
 tests/virtio-rng-test.c              |  25 +-
 tests/virtio-scsi-test.c             | 155 +++---
 tests/virtio-serial-test.c           |  27 +-
 63 files changed, 5624 insertions(+), 1243 deletions(-)
 create mode 100644 tests/libqos/e1000e.c
 create mode 100644 tests/libqos/e1000e.h
 create mode 100644 tests/libqos/ppc64_pseries-machine.c
 create mode 100644 tests/libqos/qgraph.c
 create mode 100644 tests/libqos/qgraph.h
 create mode 100644 tests/libqos/qgraph_extra.h
 create mode 100644 tests/libqos/raspi2-machine.c
 create mode 100644 tests/libqos/sdhci.c
 create mode 100644 tests/libqos/sdhci.h
 create mode 100644 tests/libqos/virt-machine.c
 create mode 100644 tests/libqos/virtio-9p.c
 create mode 100644 tests/libqos/virtio-9p.h
 create mode 100644 tests/libqos/virtio-balloon.c
 create mode 100644 tests/libqos/virtio-balloon.h
 create mode 100644 tests/libqos/virtio-blk.c
 create mode 100644 tests/libqos/virtio-blk.h
 create mode 100644 tests/libqos/virtio-net.c
 create mode 100644 tests/libqos/virtio-net.h
 create mode 100644 tests/libqos/virtio-rng.c
 create mode 100644 tests/libqos/virtio-rng.h
 create mode 100644 tests/libqos/virtio-scsi.c
 create mode 100644 tests/libqos/virtio-scsi.h
 create mode 100644 tests/libqos/virtio-serial.c
 create mode 100644 tests/libqos/virtio-serial.h
 create mode 100644 tests/libqos/x86_64_pc-machine.c
 create mode 100644 tests/qos-test.c
 create mode 100644 tests/test-qgraph.c
 create mode 100644 tests/virtio-ccw-test.c
Signature · 1 line
2.17.1