qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,  Guenter Roeck <linux@roeck-us.net>,
	qemu-riscv@nongnu.org,  Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
	 Bin Meng <bmeng.cn@gmail.com>,
	 Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	 Alistair Francis <Alistair.Francis@wdc.com>,
	Weiwei Li <liwei1518@gmail.com>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH-for-10.1 2/2] tests/functional: Test SPI-SD adapter without SD card connected
Date: Tue, 12 Aug 2025 14:24:33 +0100	[thread overview]
Message-ID: <87ikisad0u.fsf@draig.linaro.org> (raw)
In-Reply-To: <20250808135115.77310-3-philmd@linaro.org> ("Philippe Mathieu-Daudé"'s message of "Fri, 8 Aug 2025 15:51:15 +0200")

Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> SPI-SD adapter should be usable, even without any SD card
> wired. Refactor test_riscv64_sifive_u_mmc_spi() to make it
> more generic and add another test, inspired by this report:
> https://lore.kernel.org/qemu-devel/5b2dc427-f0db-4332-a997-fe0c82415acd@roeck-us.net/
>
> Inspired-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tests/functional/test_riscv64_sifive_u.py | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/tests/functional/test_riscv64_sifive_u.py b/tests/functional/test_riscv64_sifive_u.py
> index dc4cb8a4a96..f7ab1abfd56 100755
> --- a/tests/functional/test_riscv64_sifive_u.py
> +++ b/tests/functional/test_riscv64_sifive_u.py
> @@ -27,25 +27,37 @@ class SifiveU(LinuxKernelTest):
>           'rootfs.ext2.gz'),
>          'b6ed95610310b7956f9bf20c4c9c0c05fea647900df441da9dfe767d24e8b28b')
>  
> -    def test_riscv64_sifive_u_mmc_spi(self):
> +    def do_test_riscv64_sifive_u_mmc_spi(self, connect_card):
>          self.set_machine('sifive_u')
>          kernel_path = self.ASSET_KERNEL.fetch()
>          rootfs_path = self.uncompress(self.ASSET_ROOTFS)
>  
>          self.vm.set_console()
>          kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
> -                               'root=/dev/mmcblk0 rootwait '
>                                 'earlycon=sbi console=ttySIF0 '
> -                               'panic=-1 noreboot')
> +                               'root=/dev/mmcblk0 ')
>          self.vm.add_args('-kernel', kernel_path,
> -                         '-drive', f'file={rootfs_path},if=sd,format=raw',
>                           '-append', kernel_command_line,
>                           '-no-reboot')
> +        if connect_card:
> +            self.vm.add_args('-drive', f'file={rootfs_path},if=sd,format=raw')
> +            kernel_command_line += 'panic=-1 noreboot rootwait '
> +            pattern = 'Boot successful.'
> +        else:
> +            kernel_command_line += 'panic=0 noreboot '
> +            pattern = 'Cannot open root device "mmcblk0" or unknown-block(0,0)'
> +
>          self.vm.launch()
> -        self.wait_for_console_pattern('Boot successful.')
> +        self.wait_for_console_pattern(pattern)
>  
>          os.remove(rootfs_path)
>  
> +    def _test_riscv64_sifive_u_nommc_spi(self):
> +        self.do_test_riscv64_sifive_u_mmc_spi(False)

This test won't run because of the leading _

> +
> +    def test_riscv64_sifive_u_mmc_spi(self):
> +        self.do_test_riscv64_sifive_u_mmc_spi(True)
> +
>  
>  if __name__ == '__main__':
>      LinuxKernelTest.main()

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2025-08-12 13:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08 13:51 [PATCH-for-10.1 0/2] hw/sd/ssi-sd: Return noise (dummy byte) when no card connected Philippe Mathieu-Daudé
2025-08-08 13:51 ` [PATCH-for-10.1 1/2] " Philippe Mathieu-Daudé
2025-08-08 20:12   ` Guenter Roeck
2025-08-12 13:20   ` Alex Bennée
2025-08-12 13:27     ` Philippe Mathieu-Daudé
2025-08-08 13:51 ` [PATCH-for-10.1 2/2] tests/functional: Test SPI-SD adapter without SD " Philippe Mathieu-Daudé
2025-08-12 13:24   ` Alex Bennée [this message]
2025-08-12 13:28     ` Philippe Mathieu-Daudé

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=87ikisad0u.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=Alistair.Francis@wdc.com \
    --cc=bmeng.cn@gmail.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=linux@roeck-us.net \
    --cc=liwei1518@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.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).