| 1 | #!/usr/bin/env python3 |
| 2 | # |
| 3 | # Test AmigaNG boards |
| 4 | # |
| 5 | # Copyright (c) 2023 BALATON Zoltan |
| 6 | # |
| 7 | # This work is licensed under the terms of the GNU GPL, version 2 or |
| 8 | # later. See the COPYING file in the top-level directory. |
| 9 | |
| 10 | import subprocess |
| 11 | |
| 12 | from qemu_test import QemuSystemTest, Asset |
| 13 | from qemu_test import wait_for_console_pattern |
| 14 | |
| 15 | |
| 16 | class AmigaOneMachine(QemuSystemTest): |
| 17 | |
| 18 | ASSET_IMAGE = Asset( |
| 19 | ('https://www.hyperion-entertainment.com/index.php/' |
| 20 | 'downloads?view=download&format=raw&file=25'), |
| 21 | '8ff39330ba47d4f64de4ee8fd6809e9c010a9ef17fe51e95c3c1d53437cb481f') |
| 22 | |
| 23 | def test_ppc_amigaone(self): |
| 24 | self.require_accelerator("tcg") |
| 25 | self.set_machine('amigaone') |
| 26 | self.archive_extract(self.ASSET_IMAGE, format="zip") |
| 27 | bios = self.scratch_file("u-boot-amigaone.bin") |
| 28 | with open(bios, "wb") as bios_fh: |
| 29 | subprocess.run(['tail', '-c', '524288', |
| 30 | self.scratch_file("floppy_edition", |
| 31 | "updater.image")], |
| 32 | stdout=bios_fh, check=True) |
| 33 | |
| 34 | self.vm.set_console() |
| 35 | self.vm.add_args('-bios', bios) |
| 36 | self.vm.launch() |
| 37 | wait_for_console_pattern(self, 'FLASH:') |
| 38 | |
| 39 | |
| 40 | if __name__ == '__main__': |
| 41 | QemuSystemTest.main() |