[PATCH 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/20230206150416.4604-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>, 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>, Fam Zheng <fam@euphon.net>, Su Hang <suhang16@mails.ucas.ac.cn>, Amit Shah <amit@kernel.org>
There is a newer version of this series
tests/qemu-iotests/186             |   1 +
tests/qtest/bios-tables-test.c     |  75 +++++++++++++++-
tests/qtest/device-plug-test.c     |  19 ++++
tests/qtest/drive_del-test.c       |  70 +++++++++++++++
tests/qtest/fuzz-lsi53c895a-test.c |   4 +
tests/qtest/hd-geo-test.c          |  38 +++++---
tests/qtest/hexloader-test.c       |   5 ++
tests/qtest/libqtest.c             | 137 ++++++++++++++++++++++++++++-
tests/qtest/libqtest.h             |  12 +++
tests/qtest/meson.build            |  11 ++-
tests/qtest/pxe-test.c             |   4 +
tests/qtest/virtio-net-failover.c  |   5 ++
tests/qtest/virtio-serial-test.c   |   4 +
13 files changed, 363 insertions(+), 22 deletions(-)
[PATCH 00/12] qtests vs. default devices
Posted by Fabiano Rosas 1 year, 2 months ago
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_ROOT for virtio-net-failover.c
  tests/qtest: Skip virtio-serial-console tests if device not present
  tests/qtest: hd-geo-test: Check for missing devices
  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
  [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_args

 tests/qemu-iotests/186             |   1 +
 tests/qtest/bios-tables-test.c     |  75 +++++++++++++++-
 tests/qtest/device-plug-test.c     |  19 ++++
 tests/qtest/drive_del-test.c       |  70 +++++++++++++++
 tests/qtest/fuzz-lsi53c895a-test.c |   4 +
 tests/qtest/hd-geo-test.c          |  38 +++++---
 tests/qtest/hexloader-test.c       |   5 ++
 tests/qtest/libqtest.c             | 137 ++++++++++++++++++++++++++++-
 tests/qtest/libqtest.h             |  12 +++
 tests/qtest/meson.build            |  11 ++-
 tests/qtest/pxe-test.c             |   4 +
 tests/qtest/virtio-net-failover.c  |   5 ++
 tests/qtest/virtio-serial-test.c   |   4 +
 13 files changed, 363 insertions(+), 22 deletions(-)

-- 
2.35.3