All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: pierrick.bouvier@oss.qualcomm.com, palmer@dabbelt.com,
	alistair.francis@wdc.com, pbonzini@redhat.com,
	marcandre.lureau@redhat.com, farosas@suse.de, lvivier@redhat.com
Cc: liwei1518@gmail.com, daniel.barboza@oss.qualcomm.com,
	zhiwei_liu@linux.alibaba.com, chao.liu@processmission.com,
	portias@oss.tenstorrent.com, wxchen0913@gmail.com,
	jserv@ccns.ncku.edu.tw, marscheng@google.com,
	eleanor15x@gmail.com, qemu-devel@nongnu.org,
	qemu-riscv@nongnu.org, Kuan-Wei Chiu <visitorckw@gmail.com>
Subject: [PATCH v5 6/7] tests/functional/riscv64: Add boot test for Milk-V Duo board
Date: Sun, 27 Sep 2026 20:13:25 +0000	[thread overview]
Message-ID: <20260927201326.650943-7-visitorckw@gmail.com> (raw)
In-Reply-To: <20260927201326.650943-1-visitorckw@gmail.com>

Add a functional boot test for the Milk-V Duo board to validate the
end-to-end boot flow.

$ ./build/run ./tests/functional/riscv64/test_milkv_duo.py
TAP version 13
ok 1 test_milkv_duo.MilkvDuoMachine.test_riscv64_milkv_duo
1..1

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
---
 MAINTAINERS                                |  1 +
 tests/functional/riscv64/meson.build       |  1 +
 tests/functional/riscv64/test_milkv_duo.py | 53 ++++++++++++++++++++++
 3 files changed, 55 insertions(+)
 create mode 100755 tests/functional/riscv64/test_milkv_duo.py

diff --git a/MAINTAINERS b/MAINTAINERS
index f7e4159679..689424fd1c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1880,6 +1880,7 @@ F: hw/riscv/cv1800b.c
 F: hw/riscv/milkv_duo.c
 F: include/hw/misc/cv1800b_clk.h
 F: include/hw/riscv/cv1800b.h
+F: tests/functional/riscv64/test_milkv_duo.py
 F: tests/qtest/milkv-duo-test.c
 
 RX Machines
diff --git a/tests/functional/riscv64/meson.build b/tests/functional/riscv64/meson.build
index d1a3e6c2bf..8a4f1d00f9 100644
--- a/tests/functional/riscv64/meson.build
+++ b/tests/functional/riscv64/meson.build
@@ -18,4 +18,5 @@ tests_riscv64_system_thorough = [
   'sifive_u',
   'tt_atlantis',
   'tuxrun',
+  'milkv_duo',
 ]
diff --git a/tests/functional/riscv64/test_milkv_duo.py b/tests/functional/riscv64/test_milkv_duo.py
new file mode 100755
index 0000000000..6a7e2a5d19
--- /dev/null
+++ b/tests/functional/riscv64/test_milkv_duo.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on a Milk-V Duo machine
+#
+# Copyright (c) 2026 Kuan-Wei Chiu <visitorckw@gmail.com>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import skipIfMissingCommands, wait_for_console_pattern
+
+class MilkvDuoMachine(LinuxKernelTest):
+
+    timeout = 120
+
+    ASSET_KERNEL = Asset(
+        'https://storage.tuxboot.com/kernels/6.11.9/riscv64/Image',
+        '174f8bb87f08961e54fa3fcd954a8e31f4645f6d6af4dd43983d5e9841490fb0'
+    )
+    ASSET_DTBS = Asset(
+        'https://storage.tuxboot.com/kernels/6.11.9/riscv64/dtbs.tar.xz',
+        '97e5e65a7e6c68303e53486af120c0846ee8df572e9c15f0c4dccb831d0cef4b'
+    )
+    ASSET_ROOTFS = Asset(
+        'https://storage.tuxboot.com/buildroot/20241119/riscv64/rootfs.ext4.zst',
+        'aa4736a9872651dfc0d95e709465eedf1134fd19d42b8cb305bfd776f9801004'
+    )
+
+    @skipIfMissingCommands('zstd')
+    def test_riscv64_milkv_duo(self):
+        self.set_machine('milkv-duo')
+
+        kernel_path = self.ASSET_KERNEL.fetch()
+        dtb_path = self.archive_extract(
+            self.ASSET_DTBS, member='dtbs/sophgo/cv1800b-milkv-duo.dtb')
+        rootfs_path = self.uncompress(self.ASSET_ROOTFS)
+
+        self.vm.set_console()
+        self.vm.add_args('-bios', 'default',
+                         '-kernel', kernel_path,
+                         '-dtb', dtb_path,
+                         '-drive', f'file={rootfs_path},format=raw,id=sd-card,snapshot=on',
+                         '-device', 'sd-card,drive=sd-card',
+                         '-append', 'console=ttyS0,115200 root=/dev/mmcblk0 rootwait earlycon')
+
+        self.vm.launch()
+
+        wait_for_console_pattern(self, 'Machine model: Milk-V Duo')
+        wait_for_console_pattern(self, 'Welcome to TuxTest')
+        wait_for_console_pattern(self, 'tuxtest login:')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.56.0.rc1.315.gc6ed9934b7-goog



  parent reply	other threads:[~2026-09-27 20:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27 20:13 [PATCH v5 0/7] hw/riscv: Add support for Milk-V Duo board Kuan-Wei Chiu
2026-09-27 20:13 ` [PATCH v5 1/7] hw/char: Add dw8250 UART Kuan-Wei Chiu
2026-09-28  1:53   ` Alistair Francis
2026-09-30 13:12   ` Daniel Henrique Barboza
2026-09-30 23:53     ` Alistair Francis
2026-09-27 20:13 ` [PATCH v5 2/7] hw/misc: Add Sophgo CV1800B clock controller Kuan-Wei Chiu
2026-09-28  1:39   ` Alistair Francis
2026-09-27 20:13 ` [PATCH v5 3/7] hw/riscv: Add Sophgo CV1800B SoC support Kuan-Wei Chiu
2026-09-27 20:13 ` [PATCH v5 4/7] hw/riscv: Add Milk-V Duo board support Kuan-Wei Chiu
2026-09-27 20:13 ` [PATCH v5 5/7] tests/qtest: Add qtest for Milk-V Duo board Kuan-Wei Chiu
2026-09-27 20:13 ` Kuan-Wei Chiu [this message]
2026-09-28  1:40   ` [PATCH v5 6/7] tests/functional/riscv64: Add boot test " Alistair Francis
2026-09-27 20:13 ` [PATCH v5 7/7] docs/system/riscv: Add Milk-V Duo board documentation Kuan-Wei Chiu

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=20260927201326.650943-7-visitorckw@gmail.com \
    --to=visitorckw@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=chao.liu@processmission.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=eleanor15x@gmail.com \
    --cc=farosas@suse.de \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=liwei1518@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marscheng@google.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=portias@oss.tenstorrent.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=wxchen0913@gmail.com \
    --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 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.