qemu-e2k/tests/avocado/ppc_405.py
Daniel Henrique Barboza 6e73b98a1b avocado/ppc_405.py: check TCG accel in test_ppc_ref405ep()
Running this test without TCG support in an IBM POWER server results
in the following error:

        Command: ./qemu-system-ppc -display none -vga none (...)
-machine ref405ep (...)
        Output: qemu-system-ppc: Register sync failed... If you're using
kvm-hv.ko, only "-cpu host" is possible
qemu-system-ppc: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument

Although the host is running kvm_hv we don't have a way of differentiate
between kvm_hv and kvm_pr, meaning that this test would've failed in the
same way if kvm_pr was the KVM module loaded in the host.

Since we don't have a way of checking which KVM module is being loaded
when using avocado, make a TCG accel check in test_ppc_ref405ep().

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220310183011.110391-5-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-03-14 15:57:17 +01:00

37 lines
1.3 KiB
Python

# Test that the U-Boot firmware boots on ppc 405 machines and check the console
#
# Copyright (c) 2021 Red Hat, Inc.
#
# 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 avocado.utils import archive
from avocado_qemu import QemuSystemTest
from avocado_qemu import wait_for_console_pattern
from avocado_qemu import exec_command_and_wait_for_pattern
class Ppc405Machine(QemuSystemTest):
timeout = 90
def do_test_ppc405(self):
uboot_url = ('https://gitlab.com/huth/u-boot/-/raw/'
'taihu-2021-10-09/u-boot-taihu.bin')
uboot_hash = ('3208940e908a5edc7c03eab072c60f0dcfadc2ab');
file_path = self.fetch_asset(uboot_url, asset_hash=uboot_hash)
self.vm.set_console(console_index=1)
self.vm.add_args('-bios', file_path)
self.vm.launch()
wait_for_console_pattern(self, 'AMCC PPC405EP Evaluation Board')
exec_command_and_wait_for_pattern(self, 'reset', 'AMCC PowerPC 405EP')
def test_ppc_ref405ep(self):
"""
:avocado: tags=arch:ppc
:avocado: tags=machine:ref405ep
:avocado: tags=cpu:405ep
:avocado: tags=accel:tcg
"""
self.require_accelerator("tcg")
self.do_test_ppc405()