[PATCH v3 00/12] qtests vs. default devices

Fabiano Rosas posted 12 patches 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230213210738.9719-1-farosas@suse.de
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>
tests/qemu-iotests/186             |  1 +
tests/qtest/bios-tables-test.c     | 75 ++++++++++++++++++++++++++++--
tests/qtest/device-plug-test.c     | 41 ++++++++++++----
tests/qtest/drive_del-test.c       | 65 ++++++++++++++++++++++++++
tests/qtest/fuzz-lsi53c895a-test.c |  4 ++
tests/qtest/hd-geo-test.c          | 38 +++++++++------
tests/qtest/meson.build            | 17 +++++--
tests/qtest/pxe-test.c             |  4 ++
8 files changed, 214 insertions(+), 31 deletions(-)
[PATCH v3 00/12] qtests vs. default devices
Posted by Fabiano Rosas 1 year, 2 months ago
I based this on master this time, the Kconfig series might take
longer.

patch 4 - changed conditional to use the same style as surrounding
          code;

v2:

patch 3 - fixed typo s/PCIE_ROOT/PCIE_PORT and dropped runtime check;

patch 4 - dropped runtime check and added a dep on CONFIG_VIRTIO_SERIAL;

patch 7 - added skip messages and folded look_for_device_builtin into
          has_device_builtin;

patch 9 - dropped runtime check;

v1:
https://lore.kernel.org/r/20230206150416.4604-1-farosas@suse.de

Most of our tests assume the presence of default devices. When
building --without-default-devices or with individual CONFIGs
disabled, several tests fail.

I went through them one by one and did local changes to skip or avoid
including tests that require devices that are missing. With these
initial changes, 'make check' now passes for the
--without-default-devices build for x86 and arm.

However, the approach of making local changes seems hard to maintain:
every time a CONFIG changes from 'y' to 'n' a test might break and all
new tests need to remember to check before adding devices, which some
tests add several.

So the last patch in the series provides an alternative: Parse the
command line at qtest_init and skip the test if devices are
missing. Individual tests would have to check 'if (!qts)' and
bail. Seems a bit heavy-weight, but it would mean we don't have to put
a qtest_has_device check for every device in every test.

Based on: <20230206140809.26028-1-farosas@suse.de>
[PATCH 00/10] Kconfig vs. default devices
https://lore.kernel.org/r/20230206140809.26028-1-farosas@suse.de

Fabiano Rosas (12):
  tests/qtest: Skip PXE tests for missing devices
  tests/qtest: Do not run lsi53c895a test if device is not present
  tests/qtest: Add dependence on PCIE_PORT for virtio-net-failover.c
  tests/qtest: Don't build virtio-serial-test.c if device not present
  tests/qtest: hd-geo-test: Check for missing devices
  tests/qtest: Fix coding style in device-plug-test.c
  tests/qtest: Skip unplug tests that use missing devices
  tests/qtest: drive_del-test: Skip tests that require missing devices
  tests/qtest: Check for devices in bios-tables-test
  tests/qtest: Do not include hexloader-test if loader device is not
    present
  tests/qemu-iotests: Require virtio-scsi-pci
  tests/qtest: bios-tables-test: Skip if missing configs

 tests/qemu-iotests/186             |  1 +
 tests/qtest/bios-tables-test.c     | 75 ++++++++++++++++++++++++++++--
 tests/qtest/device-plug-test.c     | 41 ++++++++++++----
 tests/qtest/drive_del-test.c       | 65 ++++++++++++++++++++++++++
 tests/qtest/fuzz-lsi53c895a-test.c |  4 ++
 tests/qtest/hd-geo-test.c          | 38 +++++++++------
 tests/qtest/meson.build            | 17 +++++--
 tests/qtest/pxe-test.c             |  4 ++
 8 files changed, 214 insertions(+), 31 deletions(-)

-- 
2.35.3