mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
3fbb78cfdc
commit
6a564c8a18
4 changed files with 47 additions and 65 deletions
36
tests/functional/test_riscv_opensbi.py
Executable file
36
tests/functional/test_riscv_opensbi.py
Executable file
|
@ -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()
|
Loading…
Add table
Add a link
Reference in a new issue