All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: Joel Stanley <joel@jms.id.au>,
	 Alistair Francis <alistair.francis@wdc.com>,
	Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>,
	 Michael Ellerman <mpe@kernel.org>,
	Joel Stanley <jms@oss.tenstorrent.com>,
	 Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>,
	qemu-riscv@nongnu.org, qemu-devel@nongnu.org,
	Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH v3 11/13] tests/functional/riscv64: Add tt-atlantis tests
Date: Tue, 21 Apr 2026 19:45:30 +1000	[thread overview]
Message-ID: <aedEGxGq1qKhGI5d@lima-default> (raw)
In-Reply-To: <87ba28f4-aeab-4015-8f9c-9d3a53c0cb7a@linaro.org>

On Tue, Apr 21, 2026 at 08:05:48AM +0200, Philippe Mathieu-Daudé wrote:
> On 21/4/26 07:31, Joel Stanley wrote:
> > From: Nicholas Piggin <npiggin@gmail.com>
> > 
> > Add OpenSBI and Linux boot tests for the tt-atlantis machine. Based on
> > tests/functional/riscv64/test_sifive_u.py.
> > 
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > Signed-off-by: Joel Stanley <joel@jms.id.au>
> > ---
> > v3:
> >   - Fix path to test files
> >   - Dedupe command line root argument
> >   - Remove unused import
> > ---
> >   MAINTAINERS                                  |  1 +
> >   tests/functional/riscv64/meson.build         |  1 +
> >   tests/functional/riscv64/test_opensbi.py     |  4 ++
> >   tests/functional/riscv64/test_tt_atlantis.py | 63 ++++++++++++++++++++
> >   4 files changed, 69 insertions(+)
> >   create mode 100755 tests/functional/riscv64/test_tt_atlantis.py
> 
> 
> > diff --git a/tests/functional/riscv64/test_tt_atlantis.py b/tests/functional/riscv64/test_tt_atlantis.py
> > new file mode 100755
> > index 000000000000..f6f4b7ceec34
> > --- /dev/null
> > +++ b/tests/functional/riscv64/test_tt_atlantis.py
> > @@ -0,0 +1,63 @@
> > +#!/usr/bin/env python3
> > +#
> > +# Functional test that boots a Linux kernel on a Tenstorrent Atlantis machine
> > +# and checks the console
> > +#
> > +# Copyright (c) Linaro Ltd.
> > +# Copyright 2026 Tenstorrent
> > +#
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +
> > +import os
> > +
> > +from qemu_test import Asset, LinuxKernelTest
> > +
> > +
> > +class TTAtlantis(LinuxKernelTest):
> > +
> > +    ASSET_KERNEL = Asset(
> > +        'https://storage.tuxboot.com/kernels/6.11.9/riscv64/Image',
> > +        '174f8bb87f08961e54fa3fcd954a8e31f4645f6d6af4dd43983d5e9841490fb0')
> > +    ASSET_ROOTFS = Asset(
> > +        ('https://github.com/groeck/linux-build-test/raw/'
> > +         '9819da19e6eef291686fdd7b029ea00e764dc62f/rootfs/riscv64/'
> > +         'rootfs.ext2.gz'),
> > +        'b6ed95610310b7956f9bf20c4c9c0c05fea647900df441da9dfe767d24e8b28b')
> > +
> > +    def do_test_riscv64_tt_atlantis(self, connect_disk):
> > +        self.set_machine('tt-atlantis')
> > +        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 + 'earlycon=sbi '
> > +
> > +        if connect_disk:
> > +            kernel_command_line += 'root=/dev/vda panic=-1 noreboot rootwait '
> > +            self.vm.add_args('-device',
> > +                             'virtio-blk,drive=drive0,serial=0x1234,bus=pcie.0')
> > +            self.vm.add_args('-drive',
> > +                             f'file={rootfs_path},if=none,id=drive0,format=raw')
> > +            pattern = 'Boot successful.'
> 
> Should we run a full shutdown to test up to the halting payload
> (patch #4)?

Halting payload is only used when there is no kernel given, not sure if
it's good cost/benefit to test that, it's just in case user screw up
they don't get blank screen apparent hang.

A shutdown test all the way to machine halt would be good, although I
don't know if we model that properly in the atlantis machine yet. Maybe
something to expand on later.

> 
> > +        else:
> > +            kernel_command_line += 'panic=0 noreboot '
> > +            pattern = 'Cannot open root device'
> > +
> > +        self.vm.add_args('-kernel', kernel_path,
> > +                         '-append', kernel_command_line,
> > +                         '-no-reboot')
> > +
> > +        self.vm.launch()
> > +        self.wait_for_console_pattern(pattern)
> > +
> > +        os.remove(rootfs_path)
> 
> Since you call uncompress() with implicit @target=None argument,
> scratch_file() is used:
> 
>         Construct a path for accessing/creating a scratch file
>         located relative to a temporary directory dedicated to
>         this test case. The directory and its contents will be
>         purged upon completion of the test.
> 
> So IIUC no need to remove manually. Do you have an issue with it
> to remove it manually?

No, I just copied it from tests/functional/riscv64/test_sifive_u.py :)
and looks like same pattern exists in a couple of other tests as well.

> 
> Otherwise,
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Thanks,
Nick

> 
> > +
> > +    def test_riscv64_tt_atlantis(self):
> > +        self.do_test_riscv64_tt_atlantis(False)
> > +
> > +    def test_riscv64_tt_atlantis_disk(self):
> > +        self.do_test_riscv64_tt_atlantis(True)
> > +
> > +
> > +if __name__ == '__main__':
> > +    LinuxKernelTest.main()
> 
> 


  reply	other threads:[~2026-04-21  9:46 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21  5:31 [PATCH v3 00/13] hw/riscv: Add the Tenstorrent Atlantis machine Joel Stanley
2026-04-21  5:31 ` [PATCH v3 01/13] hw/i2c: Add designware i2c controller Joel Stanley
2026-04-21  5:31 ` [PATCH v3 02/13] hw/riscv/boot: Describe discontiguous memory in boot_info Joel Stanley
2026-04-22  0:04   ` Alistair Francis
2026-04-21  5:31 ` [PATCH v3 03/13] hw/riscv/boot: Account for discontiguous memory when loading firmware Joel Stanley
2026-04-21  5:47   ` Philippe Mathieu-Daudé
2026-04-23  1:58     ` Joel Stanley
2026-04-21  5:31 ` [PATCH v3 04/13] hw/riscv/boot: Provide a simple halting payload Joel Stanley
2026-04-21  5:48   ` Philippe Mathieu-Daudé
2026-04-23  2:04     ` Joel Stanley
2026-04-23  8:29       ` Philippe Mathieu-Daudé
2026-04-21  5:31 ` [PATCH v3 05/13] hw/riscv/virt: Move AIA initialisation to helper file Joel Stanley
2026-04-21  6:11   ` Philippe Mathieu-Daudé
2026-04-21  5:31 ` [PATCH v3 06/13] hw/riscv/aia: Provide number of irq sources Joel Stanley
2026-04-21  5:49   ` Philippe Mathieu-Daudé
2026-04-21  5:31 ` [PATCH v3 07/13] target/riscv: tt-ascalon: Enable Zkr extension Joel Stanley
2026-04-22  8:24   ` Chao Liu
2026-04-21  5:31 ` [PATCH v3 08/13] target/riscv: tt-ascalon: Add Svadu extension Joel Stanley
2026-04-21  5:31 ` [PATCH v3 09/13] hw/riscv: Add Tenstorrent Atlantis machine Joel Stanley
2026-04-21  5:52   ` Philippe Mathieu-Daudé
2026-04-22  9:12   ` Chao Liu
2026-04-21  5:31 ` [PATCH v3 10/13] hw/riscv/atlantis: Add PCIe controller Joel Stanley
2026-04-21  5:59   ` Philippe Mathieu-Daudé
2026-04-21  9:10     ` Nicholas Piggin
2026-04-21 12:59       ` Philippe Mathieu-Daudé
2026-04-21  5:31 ` [PATCH v3 11/13] tests/functional/riscv64: Add tt-atlantis tests Joel Stanley
2026-04-21  6:05   ` Philippe Mathieu-Daudé
2026-04-21  9:45     ` Nicholas Piggin [this message]
2026-04-21 15:35       ` Philippe Mathieu-Daudé
2026-04-23  2:25         ` Joel Stanley
2026-04-21  5:31 ` [PATCH v3 12/13] hw/riscv/atlantis: Integrate i2c buses Joel Stanley
2026-04-21  6:07   ` Philippe Mathieu-Daudé
2026-04-21  5:31 ` [PATCH v3 13/13] hw/riscv/atlantis: Add some i2c peripherals Joel Stanley
2026-04-21  6:09   ` Philippe Mathieu-Daudé
2026-04-23  2:23     ` Joel Stanley

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=aedEGxGq1qKhGI5d@lima-default \
    --to=npiggin@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=asrinivasan@oss.tenstorrent.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=jms@oss.tenstorrent.com \
    --cc=joel@jms.id.au \
    --cc=mpe@kernel.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@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 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.