aboutsummaryrefslogtreecommitdiff
path: root/tests/functional
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2024-08-21 10:27:23 +0200
committerThomas Huth <thuth@redhat.com>2024-11-08 06:13:34 +0100
commit6a564c8a183fb585d8fedf055b3566cb1f7a9b07 (patch)
tree110d62628ec131af63c30a26e0c0cf9f910eff3b /tests/functional
parent3fbb78cfdc37910bebd6e146d14145da65dda9bb (diff)
downloadqemu-6a564c8a183fb585d8fedf055b3566cb1f7a9b07.zip
qemu-6a564c8a183fb585d8fedf055b3566cb1f7a9b07.tar.gz
qemu-6a564c8a183fb585d8fedf055b3566cb1f7a9b07.tar.bz2
tests/functional: Convert the riscv_opensbi avocado test into a standalone test
The avocado test defined test functions for both, riscv32 and riscv64. Since we can run the whole file with multiple targets in the new framework, we can now consolidate the functions so we have to only define one function per machine now. Message-ID: <20240821082748.65853-23-thuth@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/meson.build12
-rwxr-xr-xtests/functional/test_riscv_opensbi.py36
2 files changed, 46 insertions, 2 deletions
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index d5296bf..b5691f9 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -146,18 +146,26 @@ tests_ppc64_system_thorough = [
'ppc64_tuxrun',
]
-tests_rx_system_thorough = [
- 'rx_gdbsim',
+tests_riscv32_system_quick = [
+ 'riscv_opensbi',
]
tests_riscv32_system_thorough = [
'riscv32_tuxrun',
]
+tests_riscv64_system_quick = [
+ 'riscv_opensbi',
+]
+
tests_riscv64_system_thorough = [
'riscv64_tuxrun',
]
+tests_rx_system_thorough = [
+ 'rx_gdbsim',
+]
+
tests_s390x_system_thorough = [
's390x_ccw_virtio',
's390x_topology',
diff --git a/tests/functional/test_riscv_opensbi.py b/tests/functional/test_riscv_opensbi.py
new file mode 100755
index 0000000..d077e40
--- /dev/null
+++ b/tests/functional/test_riscv_opensbi.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+#
+# OpenSBI boot test for RISC-V machines
+#
+# Copyright (c) 2022, Ventana Micro
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+
+from qemu_test import QemuSystemTest
+from qemu_test import wait_for_console_pattern
+
+class RiscvOpenSBI(QemuSystemTest):
+
+ timeout = 5
+
+ def boot_opensbi(self):
+ self.vm.set_console()
+ self.vm.launch()
+ wait_for_console_pattern(self, 'Platform Name')
+ wait_for_console_pattern(self, 'Boot HART MEDELEG')
+
+ def test_riscv_spike(self):
+ self.set_machine('spike')
+ self.boot_opensbi()
+
+ def test_riscv_sifive_u(self):
+ self.set_machine('sifive_u')
+ self.boot_opensbi()
+
+ def test_riscv_virt(self):
+ self.set_machine('virt')
+ self.boot_opensbi()
+
+if __name__ == '__main__':
+ QemuSystemTest.main()