[PATCH v2 0/5] tests/functional: Adapt reverse_debugging to run w/o Avocado

Gustavo Romero posted 5 patches 1 day, 20 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250904154640.52687-1-gustavo.romero@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Zhao Liu <zhao1.liu@intel.com>
configure                                     |   2 +
meson.build                                   |   4 +
meson_options.txt                             |   2 +
scripts/meson-buildoptions.sh                 |   2 +
tests/functional/aarch64/meson.build          |   7 +-
.../functional/aarch64/test_reverse_debug.py  |  15 +-
tests/functional/meson.build                  |  65 +++++++
tests/functional/ppc64/meson.build            |   7 +-
tests/functional/ppc64/test_reverse_debug.py  |  17 +-
tests/functional/reverse_debugging.py         | 175 +++++++++---------
tests/functional/x86_64/meson.build           |   7 +-
tests/functional/x86_64/test_reverse_debug.py |  21 +--
tests/guest-debug/run-test.py                 |  86 +++++----
13 files changed, 253 insertions(+), 157 deletions(-)
[PATCH v2 0/5] tests/functional: Adapt reverse_debugging to run w/o Avocado
Posted by Gustavo Romero 1 day, 20 hours ago
The goal of this series is to remove Avocado as a dependency for running
the reverse_debugging functional test.

This test, the last one I’m aware of that relies on Avocado, requires it
because of the need for GDB to test reverse stepping, continue, etc.

In this series, we leveraged the run-test.py script used in the
check-tcg tests, making it a GDB runner capable of calling a test script
without spawning any VMs. In this configuration, the test scripts can
manage the VM and also import gdb, making the GDB Python API inside the
functional test scripts.

A --quiet option has been added to run-test.py so it doesn't print the
command line used to execute GDB to the stdout. This ensures that users
don't get confused about how to re-run the tests. One can re-run the
test simply by copying and pasting the command line shown by Meson when
V=1 is passed:

$ make -j check-functional V=1

or, alternatively, once the test run completes, the exact command found
in the 'command:' field of the build/meson-logs/testlog-thorough.txt
file generated by Meson. Both methods provide the correct environment
variables required to run the test, such as the proper $PYTHONPATH.

The test is kept “skipped” for aarch64, ppc64, and x86_64, so it is
necessary to set QEMU_TEST_FLAKY_TESTS=1 in the test environment to
effectively run the test on these archs.

On aarch64, the test is flaky, but there is a fix that I’ve tested while
writing this series [0] that resolves it. On ppc64 and x86_64, the test
always fails: on ppc64, GDB gets a bogus PC, and on x86_64, the last
part of the test (reverse-continue) does not hit the last executed PC
(as it should) but instead jumps to the beginning of the code (first PC
in forward order).

Thus, to effectively run the reverse_debugging test on aarch64:

$ export QEMU_TEST_FLAKY_TESTS=1
$ make check-functional


Cheers,
Gustavo

v2:
- Rebased on top of master, which split tests in tests/functional/<arch>
- No abrupt exit from GDB since it will throw an exception in recent GDB versions 
- Fixed report of passed/failed/skipped to Meson
- Improved detection of the GDB in meson.build by using GDB probed by ./configure
- Separate run-test.py changes to ease reviewing  
- Added --quiet option to run-test.py


Gustavo Romero (5):
  tests/guest-debug: Make QEMU optional in run-test.py
  tests/guest-debug: Format comments
  tests/guest-debug: Add quiet option to run-tests.py
  tests/functional: Support tests that require a runner
  tests/functional: Adapt reverse_debugging to run w/o Avocado

 configure                                     |   2 +
 meson.build                                   |   4 +
 meson_options.txt                             |   2 +
 scripts/meson-buildoptions.sh                 |   2 +
 tests/functional/aarch64/meson.build          |   7 +-
 .../functional/aarch64/test_reverse_debug.py  |  15 +-
 tests/functional/meson.build                  |  65 +++++++
 tests/functional/ppc64/meson.build            |   7 +-
 tests/functional/ppc64/test_reverse_debug.py  |  17 +-
 tests/functional/reverse_debugging.py         | 175 +++++++++---------
 tests/functional/x86_64/meson.build           |   7 +-
 tests/functional/x86_64/test_reverse_debug.py |  21 +--
 tests/guest-debug/run-test.py                 |  86 +++++----
 13 files changed, 253 insertions(+), 157 deletions(-)

-- 
2.34.1