From: Fabiano Rosas <farosas@suse.de>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 12/12] [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_args
Date: Tue, 07 Feb 2023 12:35:44 -0300 [thread overview]
Message-ID: <87v8kdmqsv.fsf@suse.de> (raw)
In-Reply-To: <8a4b8438-98a4-71fa-cf73-005139b97b95@redhat.com>
Thomas Huth <thuth@redhat.com> writes:
> On 06/02/2023 16.04, Fabiano Rosas wrote:
>> The QEMU binary can be built with a varied set of features/devices
>> which are opaque to the tests. Add a centralized point for parsing and
>> validating the command line.
>>
>> Tests can now be skipped with the following pattern:
>>
>> qts = qtest_init(args);
>> if (!qts) {
>> return;
>> }
>>
>> For now, the only validation is that the -device options all
>> correspond to devices that are actually present in the build.
>>
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>> Would this be better than checking for missing devices in individual
>> tests?
>
> This is certainly an interesting idea! ... some things still bug me, though:
>
> - We still need to change all the calling sites (to check for
> !qts) ... so the effort seems to be in a similar ballpark as
> adding qtest_has_device() to the various problematic tests
Just notice that this series does not cover _all_ -device uses, only the
ones that refer to devices disabled by --without-default-devices. So we
might need to come back to this when some CONFIG changes, new devices
are added, new tests, etc.
> - This will now call qtest_has_device for each and every device
> in the parameter list, even if it is not necessary. And at
> least the first call to qtest_has_device() is rather expensive
> since it has to fire up a separate QEMU to retrieve the list
> of supported the devices. So adding this to all tests might
> cause a slow-down to the tests...
Yes, that was my main concern. We could have something like this patch
but as a helper that tests can call. Initially, I had thought of:
if (qtest_validate_args(args)) {
qts = qtest_init(args);
}
> - It could maybe even hide bugs if you don't look closely, e.g.
> if you have a typo in the device name in a test, the test then
> gets skipped automatically instead of failing ... ok, that's
> unlikely for new tests where you look closely, but still, it
> gives me slightly bad feeling.
I agree. In fact I have been looking into making the same change (as
this patch) in the avocado tests, which of course all fail
without-default-devices. There it's considerably simpler (because
Python), but I'm still thinking about how to avoid hiding a legitimate
failure.
> So I think I rather tend to go for explicit calls to qtest_has_device() as
> you did in your first 11 patches.
Ok, I'll send just them for v2, unless anyone else has something to say.
prev parent reply other threads:[~2023-02-07 15:36 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 15:04 [PATCH 00/12] qtests vs. default devices Fabiano Rosas
2023-02-06 15:04 ` [PATCH 01/12] tests/qtest: Skip PXE tests for missing devices Fabiano Rosas
2023-02-07 13:14 ` Thomas Huth
2023-02-06 15:04 ` [PATCH 02/12] tests/qtest: Do not run lsi53c895a test if device is not present Fabiano Rosas
2023-02-06 15:31 ` Philippe Mathieu-Daudé
2023-02-06 17:46 ` Fabiano Rosas
2023-02-06 18:52 ` Philippe Mathieu-Daudé
2023-02-07 13:12 ` Thomas Huth
2023-02-07 14:02 ` Fabiano Rosas
2023-02-07 14:12 ` Thomas Huth
2023-02-06 15:04 ` [PATCH 03/12] tests/qtest: Add dependence on PCIE_ROOT for virtio-net-failover.c Fabiano Rosas
2023-02-07 13:22 ` Thomas Huth
2023-02-07 15:02 ` Fabiano Rosas
2023-02-06 15:04 ` [PATCH 04/12] tests/qtest: Skip virtio-serial-console tests if device not present Fabiano Rosas
2023-02-07 13:25 ` Thomas Huth
2023-02-07 15:35 ` Laurent Vivier
2023-02-07 13:37 ` Thomas Huth
2023-02-06 15:04 ` [PATCH 05/12] tests/qtest: hd-geo-test: Check for missing devices Fabiano Rosas
2023-02-07 13:52 ` Thomas Huth
2023-02-06 15:04 ` [PATCH 06/12] tests/qtest: Skip unplug tests that use " Fabiano Rosas
2023-02-07 13:59 ` Thomas Huth
2023-02-07 14:17 ` Fabiano Rosas
2023-02-07 14:22 ` Thomas Huth
2023-02-06 15:04 ` [PATCH 07/12] tests/qtest: drive_del-test: Skip tests that require " Fabiano Rosas
2023-02-07 14:20 ` Thomas Huth
2023-02-07 14:32 ` Fabiano Rosas
2023-02-06 15:04 ` [PATCH 08/12] tests/qtest: Check for devices in bios-tables-test Fabiano Rosas
2023-02-06 15:21 ` Michael S. Tsirkin
2023-02-06 15:04 ` [PATCH 09/12] tests/qtest: Do not include hexloader-test if loader device is not present Fabiano Rosas
2023-02-07 14:30 ` Thomas Huth
2023-02-06 15:04 ` [PATCH 10/12] tests/qemu-iotests: Require virtio-scsi-pci Fabiano Rosas
2023-02-07 14:32 ` Thomas Huth
2023-02-06 15:04 ` [PATCH 11/12] tests/qtest: bios-tables-test: Skip if missing configs Fabiano Rosas
2023-02-07 14:35 ` Thomas Huth
2023-02-07 14:42 ` Michael S. Tsirkin
2023-02-08 10:52 ` Igor Mammedov
2023-02-08 14:25 ` Michael S. Tsirkin
2023-02-06 15:04 ` [PATCH 12/12] [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_args Fabiano Rosas
2023-02-07 14:55 ` Thomas Huth
2023-02-07 15:35 ` Fabiano Rosas [this message]
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=87v8kdmqsv.fsf@suse.de \
--to=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.