All of lore.kernel.org
 help / color / mirror / Atom feed
From: 54weasels <54weasels@gmail.com>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu, thuth@redhat.com, 54weasels <54weasels@gmail.com>
Subject: [PATCH 7/7] tests/functional: Add Sun-3 firmware boot and diagnostic test
Date: Sat,  2 May 2026 18:57:56 -0700	[thread overview]
Message-ID: <20260503015756.99176-8-54weasels@gmail.com> (raw)
In-Reply-To: <20260503015756.99176-1-54weasels@gmail.com>

This adds an integration test that downloads the Sun-3/60 Boot PROM, initializes the machine, and ensures the self-test successfully routes to TTY A.

Signed-off-by: 54weasels <54weasels@gmail.com>
---
 tests/functional/m68k/meson.build   |  1 +
 tests/functional/m68k/test_sun3.py  | 34 +++++++++++++++++++++++++++++
 tests/functional/qemu_test/asset.py | 11 +++++-----
 3 files changed, 41 insertions(+), 5 deletions(-)
 create mode 100755 tests/functional/m68k/test_sun3.py

diff --git a/tests/functional/m68k/meson.build b/tests/functional/m68k/meson.build
index 679faaf86d..601c28d863 100644
--- a/tests/functional/m68k/meson.build
+++ b/tests/functional/m68k/meson.build
@@ -9,5 +9,6 @@ tests_m68k_system_thorough = [
   'nextcube',
   'replay',
   'q800',
+  'sun3',
   'tuxrun',
 ]
diff --git a/tests/functional/m68k/test_sun3.py b/tests/functional/m68k/test_sun3.py
new file mode 100755
index 0000000000..f441184616
--- /dev/null
+++ b/tests/functional/m68k/test_sun3.py
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#!/usr/bin/env python3
+#
+# Functional test that boots a Sun-3 machine and checks its serial console.
+#
+# Copyright (c) 2026
+#
+
+
+import os
+from qemu_test import QemuSystemTest, Asset
+from qemu_test import wait_for_console_pattern
+
+class Sun3Machine(QemuSystemTest):
+    timeout = 60
+
+    ASSET_PROM = Asset(
+        'https://github.com/54weasels/sun3_60/raw/main/bootprom/boot_1810_01.BIN',
+        '471bf34cc9313814726c2e3506d85a13291603e37b45aaffa71bc1154a2d4851'
+    )
+
+    def test_m68k_sun3_boot(self):
+        self.set_machine('sun3')
+        prom_path = self.ASSET_PROM.fetch()
+
+        # Sun-3 maps TTY A to serial_hd(3)
+        self.vm.set_console(console_index=3)
+        self.vm.add_args('-bios', prom_path)
+        self.vm.launch()
+
+        wait_for_console_pattern(self, '>')
+
+if __name__ == '__main__':
+    QemuSystemTest.main()
diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 51a434b2b7..eac1e60536 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -223,11 +223,12 @@ def fetch(self):
             raise AssetError(self, "Download retries exceeded", transient=True)
 
         try:
-            # Set these just for informational purposes
-            os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
-                        self.url.encode('utf8'))
-            os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
-                        self.hash.encode('utf8'))
+            if hasattr(os, 'setxattr'):
+                # Set these just for informational purposes
+                os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
+                            self.url.encode('utf8'))
+                os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
+                            self.hash.encode('utf8'))
         except OSError as e:
             self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, e)
 
-- 
2.50.1 (Apple Git-155)



      parent reply	other threads:[~2026-05-03  6:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-03  1:57 [PATCH 0/7] m68k: Add Sun-3 Machine Emulation 54weasels
2026-05-03  1:57 ` [PATCH 1/7] target/m68k: Implement Physical Bus Error exception handling 54weasels
2026-05-10  5:40   ` Thomas Huth
2026-05-11  6:38     ` Purr Box
2026-05-03  1:57 ` [PATCH 2/7] hw/net/lance: Add Sun-3 Native DMA byte-swapping support 54weasels
2026-05-03  1:57 ` [PATCH 3/7] hw/char/escc: Expose diagnostic RS232 I/O routing 54weasels
2026-05-03  1:57 ` [PATCH 4/7] hw/timer: Introduce Intersil 7170 RTC implementation 54weasels
2026-05-03  1:57 ` [PATCH 5/7] hw/m68k: Overhaul Sun-3 MMU and Boot PROM mapping 54weasels
2026-05-03  1:57 ` [PATCH 6/7] tests/qtest: Add Sun-3 hardware interaction tests 54weasels
2026-05-03  1:57 ` 54weasels [this message]

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=20260503015756.99176-8-54weasels@gmail.com \
    --to=54weasels@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@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.