qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH 2/2] tests/functional: Add a functional test for the sx1 board
Date: Thu, 17 Oct 2024 19:18:30 +0200	[thread overview]
Message-ID: <70ac6525-85d6-4d0d-bf35-4d6bc924c8a8@redhat.com> (raw)
In-Reply-To: <20241017163247.711244-3-peter.maydell@linaro.org>

On 17/10/2024 18.32, Peter Maydell wrote:
> Add a functional test for the sx1 board that uses the kernel and
> rootfs provided by Guenter Roeck in the linux-test-downloads repo:
>   https://github.com/groeck/linux-test-downloads/
> 
> We have three variants of the test for this board:
>    * just boot initrd
>    * boot with filesystem on SD card
>    * boot from flash
> 
> In all cases these images have a userspace that is configured to
> immediately reboot the system on successful boot, and the board
> itself supports telling QEMU to do the reboot, so we only need to
> wait for QEMU to exit (via -no-reboot).
> 
> Since there are three subtests, the test as a whole takes about
> 80s on my local machine. That's about the same as the aarch64_virt
> test, so give it the same overall test timeout as that one.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> The sdcard test requires the 'hw/sd/omap_mmc: Don't use sd_cmd_type_t' bugfix.
> ---
>   tests/functional/meson.build     |  2 +
>   tests/functional/test_arm_sx1.py | 72 ++++++++++++++++++++++++++++++++
>   2 files changed, 74 insertions(+)
>   create mode 100755 tests/functional/test_arm_sx1.py
> 
> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
> index 0450805a9c4..ec72bfaf63e 100644
> --- a/tests/functional/meson.build
> +++ b/tests/functional/meson.build
> @@ -16,6 +16,7 @@ test_timeouts = {
>     'aarch64_virt' : 360,
>     'acpi_bits' : 240,
>     'arm_raspi2' : 120,
> +  'arm_sx1' : 360,
>     'mips_malta' : 120,
>     'netdev_ethtool' : 180,
>     'ppc_40p' : 240,
> @@ -54,6 +55,7 @@ tests_arm_system_thorough = [
>     'arm_collie',
>     'arm_integratorcp',
>     'arm_raspi2',
> +  'arm_sx1',
>     'arm_vexpress',
>   ]
>   
> diff --git a/tests/functional/test_arm_sx1.py b/tests/functional/test_arm_sx1.py
> new file mode 100755
> index 00000000000..2d86405831e
> --- /dev/null
> +++ b/tests/functional/test_arm_sx1.py
> @@ -0,0 +1,72 @@
> +#!/usr/bin/env python3
> +#
> +# Copyright (c) 2024 Linaro Ltd.
> +#
> +# Functional test that boots a Linux kernel on an sx1 machine
> +# and checks the console. We have three variants:
> +#  * just boot initrd
> +#  * boot with filesystem on SD card
> +#  * boot from flash
> +# In all cases these images have a userspace that is configured
> +# to immediately reboot the system on successful boot, so we
> +# only need to wait for QEMU to exit (via -no-reboot).
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +from qemu_test import LinuxKernelTest, Asset
> +from qemu_test.utils import archive_extract
> +
> +class SX1Test(LinuxKernelTest):
> +
> +    ASSET_ZIMAGE = Asset(
> +        'https://github.com/groeck/linux-test-downloads/raw/225223f2ad7d637b34426810bf6c3b727b76a718/sx1/zImage',
> +        'a0271899a8dc2165f9e0adb2d0a57fc839ae3a469722ffc56c77e108a8887615')
> +
> +    ASSET_INITRD = Asset(
> +        'https://github.com/groeck/linux-test-downloads/raw/225223f2ad7d637b34426810bf6c3b727b76a718/sx1/rootfs-armv4.cpio',
> +        '35b0721249821aa544cd85b85d3cb8901db4c6d128eed86ab261e5d9e37d58f8')
> +
> +    ASSET_SD_FS = Asset(
> +        'https://github.com/groeck/linux-test-downloads/raw/225223f2ad7d637b34426810bf6c3b727b76a718/sx1/rootfs-armv4.ext2',
> +        'c1db7f43ef92469ebc8605013728c8950e7608439f01d13678994f0ce101c3a8')
> +
> +    ASSET_FLASH = Asset(
> +        'https://github.com/groeck/linux-test-downloads/raw/225223f2ad7d637b34426810bf6c3b727b76a718/sx1/flash',
> +        '17e6a2758fa38efd2666be0879d4751fd37d194f25168a8deede420df519b676')
> +
> +    CONSOLE_ARGS = 'console=ttyS0,115200 earlycon=uart8250,mmio32,0xfffb0000,115200n8'
> +
> +    def test_arm_sx1_initrd(self):
> +        self.set_machine('sx1')
> +        zimage_path = self.ASSET_ZIMAGE.fetch()
> +        initrd_path = self.ASSET_INITRD.fetch()
> +        self.vm.add_args('-append', f'kunit.enable=0 rdinit=/sbin/init {self.CONSOLE_ARGS}')
> +        self.vm.add_args('-no-reboot')
> +        self.launch_kernel(zimage_path,
> +                           initrd=initrd_path)
> +        self.vm.wait()
> +
> +    def test_arm_sx1_sd(self):
> +        self.set_machine('sx1')
> +        zimage_path = self.ASSET_ZIMAGE.fetch()
> +        sd_fs_path = self.ASSET_SD_FS.fetch()
> +        self.vm.add_args('-append', f'kunit.enable=0 root=/dev/mmcblk0 rootwait {self.CONSOLE_ARGS}')
> +        self.vm.add_args('-no-reboot')
> +        self.vm.add_args('-snapshot')
> +        self.vm.add_args('-drive', f'format=raw,if=sd,file={sd_fs_path}')
> +        self.launch_kernel(zimage_path)
> +        self.vm.wait()
> +
> +    def test_arm_sx1_flash(self):
> +        self.set_machine('sx1')
> +        zimage_path = self.ASSET_ZIMAGE.fetch()
> +        flash_path = self.ASSET_FLASH.fetch()
> +        self.vm.add_args('-append', f'kunit.enable=0 root=/dev/mtdblock3 rootwait {self.CONSOLE_ARGS}')
> +        self.vm.add_args('-no-reboot')
> +        self.vm.add_args('-snapshot')
> +        self.vm.add_args('-drive', f'format=raw,if=pflash,file={flash_path}')
> +        self.launch_kernel(zimage_path)
> +        self.vm.wait()
> +
> +if __name__ == '__main__':
> +    LinuxKernelTest.main()

Reviewed-by: Thomas Huth <thuth@redhat.com>



  reply	other threads:[~2024-10-17 17:19 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 16:32 [PATCH 0/2] arm: Add collie and sx functional tests Peter Maydell
2024-10-17 16:32 ` [PATCH 1/2] tests/functional: Add a functional test for the collie board Peter Maydell
2024-10-17 17:15   ` Thomas Huth
2024-10-22  4:11   ` Philippe Mathieu-Daudé
2024-10-22  7:09     ` Daniel P. Berrangé
2024-10-22  9:02       ` Peter Maydell
2024-10-22 21:45         ` Philippe Mathieu-Daudé
2024-10-17 16:32 ` [PATCH 2/2] tests/functional: Add a functional test for the sx1 board Peter Maydell
2024-10-17 17:18   ` Thomas Huth [this message]
2024-10-21  7:15 ` [PATCH 0/2] arm: Add collie and sx functional tests Thomas Huth
2024-10-21  8:01   ` Thomas Huth
2024-10-21  9:17     ` Peter Maydell
2024-10-21  9:40       ` Thomas Huth
2024-10-21 14:02       ` Guenter Roeck
2024-10-22  4:09         ` Philippe Mathieu-Daudé
2024-10-22  5:24           ` Guenter Roeck
2024-10-22 15:04           ` Guenter Roeck
2024-10-24 17:59             ` Philippe Mathieu-Daudé
2024-10-25  6:55               ` Cédric Le Goater
2024-10-25  9:57                 ` Jan Lübbe
2024-10-25 13:59                   ` Guenter Roeck
2024-10-25 15:25                     ` Jan Lübbe
2024-10-25 17:05                       ` Guenter Roeck
2024-10-26  4:47                       ` Philippe Mathieu-Daudé
2024-10-26  5:54                         ` Guenter Roeck
2024-10-26 10:02                           ` Cédric Le Goater
2024-10-26 15:32                             ` Guenter Roeck
2024-10-27 21:13                               ` Cédric Le Goater
2024-10-27 22:11                                 ` Guenter Roeck
2024-10-27 22:26                                   ` Cédric Le Goater
2024-10-28  3:32                                     ` Guenter Roeck
2024-10-28  8:41                                       ` Jan Lübbe
2024-10-29 14:40                                         ` Guenter Roeck
2024-11-01 14:14                                           ` backing storage for eMMC boot partitions Jan Lübbe
2024-11-18  9:14                                             ` Cédric Le Goater
2024-11-18 12:15                                               ` Jan Lübbe
2024-11-18 12:36                                                 ` Cédric Le Goater
2024-10-28 16:23                             ` [PATCH] hw/sd/sdcard: Fix calculation of size when using " Jan Luebbe
2024-10-29  8:31                               ` Cédric Le Goater
2024-11-02 15:06                               ` Cédric Le Goater
2024-11-04 10:33                                 ` Philippe Mathieu-Daudé
2024-11-05 16:13                               ` Michael Tokarev
2024-11-05 16:31                                 ` Cédric Le Goater

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=70ac6525-85d6-4d0d-bf35-4d6bc924c8a8@redhat.com \
    --to=thuth@redhat.com \
    --cc=linux@roeck-us.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).