All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: "Cornelia Huck" <cohuck@redhat.com>,
	"Thomas Huth" <th.huth+qemu@posteo.eu>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Peter Xu" <peterx@redhat.com>, "Warner Losh" <imp@bsdimp.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Kyle Evans" <kevans@freebsd.org>,
	"Keith Busch" <kbusch@kernel.org>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Ani Sinha" <anisinha@redhat.com>,
	"Anders Roxell" <anders.roxell@linaro.org>,
	qemu-arm@nongnu.org, "Song Gao" <gaosong@loongson.cn>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	qemu-s390x@nongnu.org,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Brad Smith" <brad@comstyle.com>,
	"Brian Cain" <brian.cain@oss.qualcomm.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Yoshinori Sato" <yoshinori.sato@nifty.com>,
	"Klaus Jensen" <its@irrelevant.dk>,
	"John Snow" <jsnow@redhat.com>
Subject: Re: [PATCH v3 12/19] tests/functional: teach tuxrun about launching gdb tests
Date: Wed, 21 Oct 2026 00:53:39 +0200	[thread overview]
Message-ID: <027d6109-bf20-4fe8-ac5f-73f12fa55bcf@linux.ibm.com> (raw)
In-Reply-To: <20261019192704.3220373-13-alex.bennee@linaro.org>



On 10/19/26 21:26, Alex Bennée wrote:
> This resurrects the hand run test script from d84842be6c5 (tests:
> remove test-gdbstub.py) and modernises it to use the shared test
> infrastructure for run-test.
> 
> We then tweak the common tuxrun code to over an alternative "launch

                                           offer?

> via gdbstub" helper which reuses the existing code but:
> 
>    - needs a vmlinux with symbols
>    - drops kaslr because it doesn't play nice with symbols
>    - extend qargs with stuff normally added by vm.launch
>    - passes kargs directly
>    - runs with the gdb run-test script
>    - log the run-test output to the console log
>    - makes --binary not mandatory
> 
> Message-ID: <20260930164649.433573-13-alex.bennee@linaro.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> 
> ---
> v3
>    - mention the nokaslr in the commit message
>    - add a comment about it to the shared kernel args
>    - drop unused failcount
>    - remove stale comment about hbreak
>    - always delete the watch point pass or fail
>    - fix unbalanced tuple in sh4's direct call of fetch_tuxrun_assets
>    - simplify the symbol to watchpoint logic
>    - drop the mandatory --binary
>    - make the command copy and paste friendly
> v2
>    - add self.vm._machine to qargs
>    - drop leading spaces in print () calls
>    - add register read tests
>    - use gdb.Breakpoint for hwbreak as for swbreak
>    - drop flaky symbol evaluation, verify hit_count instead
>    - explicit gdb.BP_BREAKPOINT for CatchBreakpoint
> ---
>   .../functional/gdb-scripts/kernel_gdb_test.py | 162 ++++++++++++++++++
>   tests/functional/qemu_test/tuxruntest.py      |  97 ++++++++++-
>   tests/functional/sh4/test_tuxrun.py           |   4 +-
>   tests/guest-debug/run-test.py                 |  14 +-
>   4 files changed, 261 insertions(+), 16 deletions(-)
>   create mode 100644 tests/functional/gdb-scripts/kernel_gdb_test.py

[...]

> @@ -132,10 +144,77 @@ def common_tuxrun(self,
>           special with the command line we can process most things using
>           the tag metadata.
>           """
> -        (kernel, disk, dtb) = self.fetch_tuxrun_assets(kernel_asset, rootfs_asset,
> -                                                       dtb_asset)
> +        (kernel, disk, dtb, _) = self.fetch_tuxrun_assets(kernel_asset,
> +                                                          rootfs_asset,
> +                                                          dtb_asset)
>   
>           self.prepare_run(accel, kernel, disk, drive, dtb, console_index)
>           self.vm.launch()
>           self.run_tuxtest_tests(haltmsg)
>           os.remove(disk)
> +
> +    def common_tuxrun_gdb(self,
> +                          kernel_asset,
> +                          vmlinux_asset,
> +                          rootfs_asset,
> +                          accel=None,
> +                          dtb_asset=None,
> +                          drive="virtio-blk-device",
> +                          haltmsg="reboot: System halted",

This argument seems to be unused.

> +                          console_index=0):
> +        """
> +        Common path for LKFT tests under gdb. Unlike the common_tuxrun
> +        function we need to launch with the gdb test script and deal
> +        with munging the arguments for that especially.
> +        """
> +        (kernel, disk, dtb, vmlinux) = self.fetch_tuxrun_assets(kernel_asset,
> +                                                                rootfs_asset,
> +                                                                dtb_asset,
> +                                                                vmlinux_asset)
> +
> +        gdb_path = os.getenv("QEMU_TEST_GDB")
> +        run_script = self.data_file('..', 'guest-debug','run-test.py')
> +        test_script = self.data_file('gdb-scripts', 'kernel_gdb_test.py')
> +
> +        # Instead of launching QEMU via the functional test machinery
> +        # we need to launch it with the gdb run script. We utilise the
> +        # existing prepare_run machinery to build the command line but
> +        # we pass the kernel args separately to avoid horrible string
> +        # escaping.
> +
> +        self.prepare_run(accel, kernel, disk, drive, dtb,
> +                         console_index, append = False)
> +
> +        # the functional test machinery adds more stuff for handling
> +        # console redirection which we need to do manually.
> +
> +        qargs = self.vm.args
> +        qargs.extend(["-display", "none", "-serial", "stdio"])
> +
> +        # and the machine type
> +        if self.vm._machine is not None:
> +            qargs.extend(["-machine", self.vm._machine])
> +
> +        cmd = [
> +            str(run_script),
> +            "--qemu", self.qemu_bin,
> +            "--qargs", " ".join(qargs),

I would use shlex.join() here, for symmetry with shlex.split() that
is used to handle this.

[...]

Anyhow:

Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>



  reply	other threads:[~2026-10-20 22:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 19:26 [PATCH v3 00/19] testing/next: functional testing updates for gdb (pre-PR) Alex Bennée
2026-10-19 19:26 ` [PATCH v3 01/19] tests/functional: test_acpi_bits requires TCG Alex Bennée
2026-10-20 22:49   ` Ilya Leoshkevich
2026-10-19 19:26 ` [PATCH v3 02/19] tests/tcg: fix buffer overflow in multiarch/linux/linux-sigrtminmax Alex Bennée
2026-10-19 19:26 ` [PATCH v3 03/19] .dir-locals: include QEMU code in PYTHONPATH Alex Bennée
2026-10-19 19:26 ` [PATCH v3 04/19] meson: move gdb detection into the top level build file Alex Bennée
2026-10-19 19:26 ` [PATCH v3 05/19] tests/functional: allow tuxrun tests to be passed "accel" Alex Bennée
2026-10-19 19:26 ` [PATCH v3 06/19] tests/functional: split x86_64 tuxrun into tcg and kvm run Alex Bennée
2026-10-19 19:26 ` [PATCH v3 07/19] tests/functional: update x86_64 tuxrun images Alex Bennée
2026-10-19 19:26 ` [PATCH v3 08/19] tests/guest-debug: convert gdb_cmd to an array Alex Bennée
2026-10-20  7:40   ` Thomas Huth
2026-10-20 11:21   ` Ilya Leoshkevich
2026-10-19 19:26 ` [PATCH v3 09/19] tests/guest-debug: convert cmd to an qemu_cmd array Alex Bennée
2026-10-20  7:43   ` Thomas Huth
2026-10-20 11:22   ` Ilya Leoshkevich
2026-10-19 19:26 ` [PATCH v3 10/19] tests/guest-debug: add --kargs option to run-test Alex Bennée
2026-10-20 11:23   ` Ilya Leoshkevich
2026-10-19 19:26 ` [PATCH v3 11/19] tests/guest-debug: add --symbols " Alex Bennée
2026-10-20 11:23   ` Ilya Leoshkevich
2026-10-19 19:26 ` [PATCH v3 12/19] tests/functional: teach tuxrun about launching gdb tests Alex Bennée
2026-10-20 22:53   ` Ilya Leoshkevich [this message]
2026-10-19 19:26 ` [PATCH v3 13/19] tests/functional: add tuxrun kvm gdb test for x86_64 Alex Bennée
2026-10-19 19:26 ` [PATCH v3 14/19] tests/functional: split aarch64 tuxrun into tcg and kvm run Alex Bennée
2026-10-19 19:27 ` [PATCH v3 15/19] tests/functional: update arm64 tuxrun images Alex Bennée
2026-10-19 19:27 ` [PATCH v3 16/19] tests/functional: add tuxrun kvm gdb test for arm64 Alex Bennée
2026-10-19 19:27 ` [PATCH v3 17/19] tests/functional: split s390x tuxrun into tcg and kvm run Alex Bennée
2026-10-19 19:27 ` [PATCH v3 18/19] tests/functional: update s390x tuxrun images Alex Bennée
2026-10-19 19:27 ` [PATCH v3 19/19] tests/functional: add tuxrun kvm gdb test for s390x Alex Bennée
2026-10-20 22:46   ` Ilya Leoshkevich
2026-10-21  8:01     ` Alex Bennée

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=027d6109-bf20-4fe8-ac5f-73f12fa55bcf@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=alex.bennee@linaro.org \
    --cc=anders.roxell@linaro.org \
    --cc=anisinha@redhat.com \
    --cc=berrange@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=brad@comstyle.com \
    --cc=brian.cain@oss.qualcomm.com \
    --cc=cohuck@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=gaosong@loongson.cn \
    --cc=imp@bsdimp.com \
    --cc=its@irrelevant.dk \
    --cc=jsnow@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=kevans@freebsd.org \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@redhat.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=th.huth+qemu@posteo.eu \
    --cc=yoshinori.sato@nifty.com \
    --cc=zhao1.liu@intel.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.