xref: /openbmc/qemu/tests/avocado/ppc_405.py (revision 6e73b98a)
1# Test that the U-Boot firmware boots on ppc 405 machines and check the console
2#
3# Copyright (c) 2021 Red Hat, Inc.
4#
5# This work is licensed under the terms of the GNU GPL, version 2 or
6# later.  See the COPYING file in the top-level directory.
7
8from avocado.utils import archive
9from avocado_qemu import QemuSystemTest
10from avocado_qemu import wait_for_console_pattern
11from avocado_qemu import exec_command_and_wait_for_pattern
12
13class Ppc405Machine(QemuSystemTest):
14
15    timeout = 90
16
17    def do_test_ppc405(self):
18        uboot_url = ('https://gitlab.com/huth/u-boot/-/raw/'
19                     'taihu-2021-10-09/u-boot-taihu.bin')
20        uboot_hash = ('3208940e908a5edc7c03eab072c60f0dcfadc2ab');
21        file_path = self.fetch_asset(uboot_url, asset_hash=uboot_hash)
22        self.vm.set_console(console_index=1)
23        self.vm.add_args('-bios', file_path)
24        self.vm.launch()
25        wait_for_console_pattern(self, 'AMCC PPC405EP Evaluation Board')
26        exec_command_and_wait_for_pattern(self, 'reset', 'AMCC PowerPC 405EP')
27
28    def test_ppc_ref405ep(self):
29        """
30        :avocado: tags=arch:ppc
31        :avocado: tags=machine:ref405ep
32        :avocado: tags=cpu:405ep
33        :avocado: tags=accel:tcg
34        """
35        self.require_accelerator("tcg")
36        self.do_test_ppc405()
37