[PATCH 0/3] qtest: Provide and use function for doing system reset

Peter Maydell posted 3 patches 1 week ago
tests/qtest/libqtest.h              | 25 +++++++++++++++++++++++++
tests/qtest/bios-tables-test.c      |  4 ++--
tests/qtest/boot-order-test.c       |  7 +------
tests/qtest/device-plug-test.c      | 11 +----------
tests/qtest/drive_del-test.c        |  7 +------
tests/qtest/hd-geo-test.c           |  9 +--------
tests/qtest/libqtest.c              | 16 ++++++++++++++++
tests/qtest/q35-test.c              | 12 ++----------
tests/qtest/qos-test.c              |  3 +--
tests/qtest/stm32l4x5_gpio-test.c   | 10 +---------
tests/qtest/stm32l4x5_syscfg-test.c | 12 ++----------
11 files changed, 53 insertions(+), 63 deletions(-)
[PATCH 0/3] qtest: Provide and use function for doing system reset
Posted by Peter Maydell 1 week ago
I noticed while reviewing Roque's patchset that adds tests
for the CMSDK watchdog device that we are gradually accumulating
tests in tests/qtest which open-code "now reset the QEMU system".
Moreover, several of those tests get it wrong, by failing to
wait for the QMP RESET event that signals that the reset has
completed.

This series adds new functions qtest_system_reset() and
qtest_system_reset_nowait(), which send the QMP system_reset
command and then either do or do not wait for the RESET event.
It uses them to replace all the places in the test suite
that currently hand-craft sending a system_reset command.

The tests that previously forgot to wait for RESET and now
do so are bios-tables-test, q35-test, stm32l4x5_gpio-test,
and stm32l4x5_syscfg-test.

thanks
-- PMM

Peter Maydell (3):
  tests/qtest: Add qtest_system_reset() utility function
  tests/qtest: Use qtest_system_reset() instead of open-coded versions
  tests/qtest: Use qtest_system_reset_nowait() where appropriate

 tests/qtest/libqtest.h              | 25 +++++++++++++++++++++++++
 tests/qtest/bios-tables-test.c      |  4 ++--
 tests/qtest/boot-order-test.c       |  7 +------
 tests/qtest/device-plug-test.c      | 11 +----------
 tests/qtest/drive_del-test.c        |  7 +------
 tests/qtest/hd-geo-test.c           |  9 +--------
 tests/qtest/libqtest.c              | 16 ++++++++++++++++
 tests/qtest/q35-test.c              | 12 ++----------
 tests/qtest/qos-test.c              |  3 +--
 tests/qtest/stm32l4x5_gpio-test.c   | 10 +---------
 tests/qtest/stm32l4x5_syscfg-test.c | 12 ++----------
 11 files changed, 53 insertions(+), 63 deletions(-)

-- 
2.34.1
Re: [PATCH 0/3] qtest: Provide and use function for doing system reset
Posted by Fabiano Rosas 1 day, 2 hours ago
On Fri, 15 Nov 2024 16:50:38 +0000, Peter Maydell wrote:
> I noticed while reviewing Roque's patchset that adds tests
> for the CMSDK watchdog device that we are gradually accumulating
> tests in tests/qtest which open-code "now reset the QEMU system".
> Moreover, several of those tests get it wrong, by failing to
> wait for the QMP RESET event that signals that the reset has
> completed.
> 
> [...]

Queued, thanks!