Hi,
On 17/7/25 11:38, Djordje Todorovic wrote:
Add functional test for Boston AIA board. The P8700 RISC-V based
CPU by MIPS supports it at the moment.
Signed-off-by: Chao-ying Fu <c...@mips.com>
Signed-off-by: Djordje Todorovic <djordje.todoro...@htecgroup.com>
---
tests/functional/meson.build | 1 +
tests/functional/test_riscv64_boston.py | 78 +++++++++++++++++++++++++
2 files changed, 79 insertions(+)
create mode 100755 tests/functional/test_riscv64_boston.py
diff --git a/tests/functional/test_riscv64_boston.py
b/tests/functional/test_riscv64_boston.py
new file mode 100755
index 0000000000..eb5dd07b79
--- /dev/null
+++ b/tests/functional/test_riscv64_boston.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+#
+# Boston board test for RISC-V P8700 processor by MIPS
+#
+# Copyright (c) 2025 MIPS
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+
+from qemu_test import QemuSystemTest
+
+class RiscvBostonTest(QemuSystemTest):
+ """
+ Test the boston-aia board with P8700 processor
+ """
+
+ timeout = 10
+
+ def test_boston_memory_constraints(self):
+ """
+ Test that boston-aia board enforces memory size constraints
+ """
+ # Test invalid memory size
+ self.set_machine('boston-aia')
+ self.vm.add_args('-cpu', 'mips-p8700')
+ self.vm.add_args('-m', '512M') # Invalid size
+ self.vm.add_args('-nographic')
+ self.vm.set_qmp_monitor(enabled=False)
+ self.vm.launch()
+ self.vm.wait()
+
+ # Should fail due to invalid memory size
+ self.assertEqual(self.vm.exitcode(), 1)
+ log = self.vm.get_log()
+ self.assertIn("Memory size must be 1GB, 2GB, 3GB, or 4GB", log)
+
+ def test_boston_requires_kernel(self):
+ """
+ Test that boston-aia board requires a kernel or bios
+ """
+ self.set_machine('boston-aia')
+ self.vm.add_args('-cpu', 'mips-p8700')
+ self.vm.add_args('-m', '1G') # Valid size
+ self.vm.add_args('-nographic')
+ # No kernel or bios specified
+ self.vm.set_qmp_monitor(enabled=False)
+ self.vm.launch()
+ self.vm.wait()
+
+ # Should fail due to missing kernel/bios
+ self.assertEqual(self.vm.exitcode(), 1)
+ log = self.vm.get_log()
+ self.assertIn("Please provide either a -kernel or -bios argument", log)
+
+ def test_boston_cpu_count(self):
+ """
+ Test various CPU counts for boston-aia board
+ """
+ cpu_counts = [1, 2, 4, 8]
+
+ for cpus in cpu_counts:
+ with self.subTest(cpus=cpus):
+ self.set_machine('boston-aia')
+ self.vm.add_args('-cpu', 'mips-p8700')
+ self.vm.add_args('-smp', str(cpus))
+ self.vm.add_args('-m', '1G')
+ self.vm.add_args('-nographic')
+ self.vm.set_qmp_monitor(enabled=False)
+ self.vm.launch()
+ self.vm.wait()
+
+ # Board should fail due to missing kernel, not CPU count
+ self.assertEqual(self.vm.exitcode(), 1)
+ log = self.vm.get_log()
+ self.assertIn("Please provide either a -kernel or -bios
argument", log)
+
+if __name__ == '__main__':
+ QemuSystemTest.main()
Thanks for testing these constraints, but can we have guest code
actually exercising the code path to the XMIPS instructions?
Also code testing powering VPs up/down, to cover CPS, GCR and CPC.
Code using the e1000e card would be awesome ;)
Thanks,
Phil.