@samitouri / QOSamiQemu / commits / 9ff5c47f80

tests/functional/riscv64: Add tt-atlantis tests

Add OpenSBI and Linux boot tests for the tt-atlantis machine. Based on tests/functional/riscv64/test_sifive_u.py. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Joel Stanley <joel@jms.id.au> Message-ID: <20260630024952.1520546-10-joel@jms.id.au> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Nicholas Piggin committed Jun 30, 2026 at 12:19 UTC 9ff5c47f80855263b36ec8fcc3ec0d3d960d4371
4 files changed +63
MAINTAINERS
+1
@@ -1801,6 +1801,7 @@ S: Supported
1801 F: docs/system/riscv/tt_*.rst
1802 F: hw/riscv/tt_*.c
1803 F: include/hw/riscv/tt_*.h
1804 +F: tests/functional/riscv64/test_tt_*.py
1805
1806 AMD Microblaze-V Generic Board
1807 M: Sai Pavan Boddu <sai.pavan.boddu@amd.com>
tests/functional/riscv64/meson.build
+1
@@ -14,5 +14,6 @@ tests_riscv64_system_thorough = [
14 'endianness',
15 'boston',
16 'sifive_u',
17 + 'tt_atlantis',
18 'tuxrun',
19 ]
tests/functional/riscv64/test_opensbi.py
+4
@@ -28,6 +28,10 @@ class RiscvOpenSBI(QemuSystemTest):
28 self.set_machine('sifive_u')
29 self.boot_opensbi()
30
31 + def test_riscv_tt_atlantis(self):
32 + self.set_machine('tt-atlantis')
33 + self.boot_opensbi()
34 +
35 def test_riscv_virt(self):
36 self.set_machine('virt')
37 self.boot_opensbi()
tests/functional/riscv64/test_tt_atlantis.py new
+57
@@ -0,0 +1,57 @@
1 +#!/usr/bin/env python3
2 +#
3 +# Functional test that boots a Linux kernel on a Tenstorrent Atlantis machine
4 +# and checks the console
5 +#
6 +# Copyright (c) Linaro Ltd.
7 +# Copyright 2026 Tenstorrent
8 +#
9 +# SPDX-License-Identifier: GPL-2.0-or-later
10 +
11 +from qemu_test import Asset, LinuxKernelTest
12 +
13 +
14 +class TTAtlantis(LinuxKernelTest):
15 +
16 + ASSET_KERNEL = Asset(
17 + 'https://storage.tuxboot.com/kernels/6.11.9/riscv64/Image',
18 + '174f8bb87f08961e54fa3fcd954a8e31f4645f6d6af4dd43983d5e9841490fb0')
19 + ASSET_ROOTFS = Asset(
20 + ('https://github.com/groeck/linux-build-test/raw/'
21 + '9819da19e6eef291686fdd7b029ea00e764dc62f/rootfs/riscv64/'
22 + 'rootfs.ext2.gz'),
23 + 'b6ed95610310b7956f9bf20c4c9c0c05fea647900df441da9dfe767d24e8b28b')
24 +
25 + def do_test_riscv64_tt_atlantis(self, connect_disk):
26 + self.set_machine('tt-atlantis')
27 + kernel_path = self.ASSET_KERNEL.fetch()
28 + rootfs_path = self.uncompress(self.ASSET_ROOTFS)
29 +
30 + self.vm.set_console()
31 + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'earlycon=sbi '
32 +
33 + if connect_disk:
34 + kernel_command_line += 'root=/dev/vda panic=-1 noreboot rootwait '
35 + self.vm.add_args('-device',
36 + 'virtio-blk,drive=drive0,serial=0x1234,bus=pcie.0')
37 + self.vm.add_args('-drive',
38 + f'file={rootfs_path},if=none,id=drive0,format=raw')
39 + pattern = 'Boot successful.'
40 + else:
41 + kernel_command_line += 'panic=0 noreboot '
42 + pattern = 'Cannot open root device'
43 +
44 + self.vm.add_args('-kernel', kernel_path,
45 + '-append', kernel_command_line,
46 + '-no-reboot')
47 +
48 + self.vm.launch()
49 + self.wait_for_console_pattern(pattern)
50 +
51 + def test_riscv64_tt_atlantis(self):
52 + # tt-atlantis machine has no PCI host yet, so no disk
53 + self.do_test_riscv64_tt_atlantis(False)
54 +
55 +
56 +if __name__ == '__main__':
57 + LinuxKernelTest.main()