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 <cfu@mips.com>
Signed-off-by: Djordje Todorovic <djordje.todorovic@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/meson.build b/tests/functional/meson.build
index 52b4706cfe..317e085bfb 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -259,6 +259,7 @@ tests_riscv32_system_thorough = [
tests_riscv64_system_quick = [
'migration',
'riscv_opensbi',
+ 'riscv64_boston',
]
tests_riscv64_system_thorough = [
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()
--
2.34.1
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 <cfu@mips.com> > Signed-off-by: Djordje Todorovic <djordje.todorovic@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.
On 8. 8. 25. 18:32, Philippe Mathieu-Daudé wrote: > CAUTION: This email originated from outside of the organization. Do > not click links or open attachments unless you recognize the sender > and know the content is safe. > > > 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 <cfu@mips.com> >> Signed-off-by: Djordje Todorovic <djordje.todorovic@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. Thanks a lot Phil! :) I agree. We created https://github.com/MIPS/linux-test-downloads/, and I will follow what was done for other architectures and make a proper test that checks Linux boot that contains XMIPS instructions as well as to cover other features we are adding here. Will be part of v7. Best, Djordje
© 2016 - 2025 Red Hat, Inc.