[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 12/12] [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_
From: |
Thomas Huth |
Subject: |
Re: [PATCH 12/12] [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_args |
Date: |
Tue, 7 Feb 2023 15:55:03 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 |
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
- 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...
- 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.
So I think I rather tend to go for explicit calls to qtest_has_device() as
you did in your first 11 patches.
Anyway, I'm interested in what do others think of this? Any other opinions?
Thomas
- [PATCH 09/12] tests/qtest: Do not include hexloader-test if loader device is not present, (continued)
[PATCH 12/12] [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_args, Fabiano Rosas, 2023/02/06
- Re: [PATCH 12/12] [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_args,
Thomas Huth <=