From: Gustavo Romero <gustavo.romero@linaro.org>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, alex.bennee@linaro.org, thuth@redhat.com,
	qemu-arm@nongnu.org
Subject: Re: [PATCH v2 5/5] tests/functional: Adapt reverse_debugging to run w/o Avocado
Date: Thu, 11 Sep 2025 20:50:18 -0300	[thread overview]
Message-ID: <9aa2f190-0bd7-4c54-b2a2-cdd67ec7023c@linaro.org> (raw)
In-Reply-To: <aL6e8PyjsfK0Wx70@redhat.com>
Hi Daniel!
On 9/8/25 06:16, Daniel P. Berrangé wrote:
> On Thu, Sep 04, 2025 at 03:46:40PM +0000, Gustavo Romero wrote:
>> This commit removes Avocado as a dependency for running the
>> reverse_debugging test.
>>
>> The main benefit, beyond eliminating an extra dependency, is that there
>> is no longer any need to handle GDB packets manually. This removes the
>> need for ad-hoc functions dealing with endianness and arch-specific
>> register numbers, making the test easier to read. The timeout variable
>> is also removed, since Meson now manages timeouts automatically.
>>
>> The reverse_debugging test is now executed through a runner, because it
>> requires GDB in addition to QMP. The runner is responsible for invoking
>> GDB with the appropriate arguments and for passing the test script to
>> GDB.
>>
>> Since the test now runs inside GDB, its output, particularly from
>> 'stepi' commands, which cannot be disabled, interleaves with the TAP
>> output from unittest. To avoid this conflict, the test no longer uses
>> Meson’s 'tap' protocol and instead relies on the simpler 'exitcode'
>> protocol.
>>
>> reverse_debugging is kept "skipped" for aarch64, ppc64, and x86_64, so
>> won't run unless QEMU_TEST_FLAKY_TESTS=1 is set in the test environment,
>> before running 'make check-functional' or 'meson test [...]'.
>>
>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
>> ---
>>   tests/functional/aarch64/meson.build          |   7 +-
>>   .../functional/aarch64/test_reverse_debug.py  |  15 +-
>>   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 +--
>>   7 files changed, 131 insertions(+), 118 deletions(-)
>>
>> diff --git a/tests/functional/aarch64/meson.build b/tests/functional/aarch64/meson.build
>> index 04846c6eb1..4f3168dd55 100644
>> --- a/tests/functional/aarch64/meson.build
>> +++ b/tests/functional/aarch64/meson.build
>> @@ -32,7 +32,6 @@ tests_aarch64_system_thorough = [
>>     'raspi3',
>>     'raspi4',
>>     'replay',
>> -  'reverse_debug',
>>     'rme_virt',
>>     'rme_sbsaref',
>>     'sbsaref',
>> @@ -46,3 +45,9 @@ tests_aarch64_system_thorough = [
>>     'xen',
>>     'xlnx_versal',
>>   ]
>> +
>> +if is_variable('gdb_runner')
>> +tests_aarch64_system_thorough_with_runner = [
>> +    ['reverse_debug', gdb_runner, 'exitcode'],
>> +]
>> +endif
> 
> Why do you need to replace the of 'tap' with 'exitcode' for this script ?
> 
> I don't like the idea that a subset of our functional tests are not using
> the TAP protocol.
Unfortunately, the GDB Python API seems to be broken regarding being able
to redirect GDB's output to a file (as it's possible to do via GDB's prompt)
so we can't redirect the printed addresses that are printed after each "stepi"
command in the test script. As a consequence Meson's TAP gets confused with
it and fails the test. Since I could not find any directive in QEMU functional
tests that forbid using the classic exitcode, I used it, at least while
the GDB redirect is not fixed.
Why don't you like it?
Cheers,
Gustavo
next prev parent reply	other threads:[~2025-09-11 23:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 15:46 [PATCH v2 0/5] tests/functional: Adapt reverse_debugging to run w/o Avocado Gustavo Romero
2025-09-04 15:46 ` [PATCH v2 1/5] tests/guest-debug: Make QEMU optional in run-test.py Gustavo Romero
2025-09-05  7:22   ` Alex Bennée
2025-09-08  9:02   ` Thomas Huth
2025-09-04 15:46 ` [PATCH v2 2/5] tests/guest-debug: Format comments Gustavo Romero
2025-09-05  7:22   ` Alex Bennée
2025-09-08  9:03   ` Thomas Huth
2025-09-04 15:46 ` [PATCH v2 3/5] tests/guest-debug: Add quiet option to run-tests.py Gustavo Romero
2025-09-05  7:21   ` Alex Bennée
2025-09-08  9:12   ` Thomas Huth
2025-09-04 15:46 ` [PATCH v2 4/5] tests/functional: Support tests that require a runner Gustavo Romero
2025-09-08  9:21   ` Thomas Huth
2025-09-04 15:46 ` [PATCH v2 5/5] tests/functional: Adapt reverse_debugging to run w/o Avocado Gustavo Romero
2025-09-05  7:21   ` Alex Bennée
2025-09-08  9:16   ` Daniel P. Berrangé
2025-09-11 23:50     ` Gustavo Romero [this message]
2025-09-08 11:49 ` [PATCH v2 0/5] " Daniel P. Berrangé
2025-09-11 23:51   ` Gustavo Romero
2025-09-12 14:49     ` Daniel P. Berrangé
2025-09-12 16:04       ` Alex Bennée
2025-09-12 16:27         ` Daniel P. Berrangé
2025-09-12 16:50           ` Peter Maydell
2025-09-15 12:49           ` Thomas Huth
2025-09-15 22:11             ` Gustavo Romero
2025-09-15  8:29 ` Daniel P. Berrangé
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=9aa2f190-0bd7-4c54-b2a2-cdd67ec7023c@linaro.org \
    --to=gustavo.romero@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).