Add tests for the recently added riscv-server-ref machine: - a new test_opensbi.py test. The idea is to have a quick test that can catch trivial regressions that would prevent OpenSBI to finish; - a new Linux boot "thorough" test that will boot the machine up to the buildroot prompt. - a TPM specific selftest for the riscv-server-ref board. The test will be skipped if there's no 'swtpm' in the host. Signed-off-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com> Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com> Reviewed-by: Nutty Liu <nutty.liu@hotmail.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Sunil V L <sunilvl@oss.qualcomm.com> Message-ID: <20260928201107.2049458-5-daniel.barboza@oss.qualcomm.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
45 lines
1.1 KiB
Python
Executable File
45 lines
1.1 KiB
Python
Executable File
#!/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_tt_atlantis(self):
|
|
self.set_machine('tt-atlantis')
|
|
self.boot_opensbi()
|
|
|
|
def test_riscv_virt(self):
|
|
self.set_machine('virt')
|
|
self.boot_opensbi()
|
|
|
|
def test_riscv_server_ref(self):
|
|
self.set_machine('riscv-server-ref')
|
|
self.boot_opensbi()
|
|
|
|
if __name__ == '__main__':
|
|
QemuSystemTest.main()
|