xref: /qemu/tests/avocado/ppc_amiga.py (revision 5db05230)
1# Test AmigaNG boards
2#
3# Copyright (c) 2023 BALATON Zoltan
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.utils import process
10from avocado_qemu import QemuSystemTest
11from avocado_qemu import wait_for_console_pattern
12
13class AmigaOneMachine(QemuSystemTest):
14
15    timeout = 90
16
17    def test_ppc_amigaone(self):
18        """
19        :avocado: tags=arch:ppc
20        :avocado: tags=machine:amigaone
21        :avocado: tags=device:articia
22        :avocado: tags=accel:tcg
23        """
24        self.require_accelerator("tcg")
25        tar_name = 'A1Firmware_Floppy_05-Mar-2005.zip'
26        tar_url = ('https://www.hyperion-entertainment.com/index.php/'
27                   'downloads?view=download&format=raw&file=25')
28        tar_hash = 'c52e59bc73e31d8bcc3cc2106778f7ac84f6c755'
29        zip_file = self.fetch_asset(tar_name, locations=tar_url,
30                                    asset_hash=tar_hash)
31        archive.extract(zip_file, self.workdir)
32        cmd = f"tail -c 524288 {self.workdir}/floppy_edition/updater.image >{self.workdir}/u-boot-amigaone.bin"
33        process.run(cmd, shell=True)
34
35        self.vm.set_console()
36        self.vm.add_args('-bios', self.workdir + '/u-boot-amigaone.bin')
37        self.vm.launch()
38        wait_for_console_pattern(self, 'FLASH:')
39