qemu/tests/functional/test_ppc_amiga.py
Daniel P. Berrangé beaf88c895 tests/functional: switch over to using self.scratch_file()
Replace any instances of

  os.path.join(self.workdir, ".../...")
  self.workdir + "/.../..."

with

  self.scratch_file("...", "...")

which is more compact and portable

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20241217155953.3950506-15-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-12-17 19:39:53 +01:00

45 lines
1.4 KiB
Python
Executable file

#!/usr/bin/env python3
#
# Test AmigaNG boards
#
# Copyright (c) 2023 BALATON Zoltan
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
import subprocess
from qemu_test import QemuSystemTest, Asset
from qemu_test import wait_for_console_pattern
from zipfile import ZipFile
class AmigaOneMachine(QemuSystemTest):
timeout = 90
ASSET_IMAGE = Asset(
('https://www.hyperion-entertainment.com/index.php/'
'downloads?view=download&format=raw&file=25'),
'8ff39330ba47d4f64de4ee8fd6809e9c010a9ef17fe51e95c3c1d53437cb481f')
def test_ppc_amigaone(self):
self.require_accelerator("tcg")
self.set_machine('amigaone')
tar_name = 'A1Firmware_Floppy_05-Mar-2005.zip'
zip_file = self.ASSET_IMAGE.fetch()
with ZipFile(zip_file, 'r') as zf:
zf.extractall(path=self.workdir)
bios = self.scratch_file("u-boot-amigaone.bin")
with open(bios, "wb") as bios_fh:
subprocess.run(['tail', '-c', '524288',
self.scratch_file("floppy_edition",
"updater.image")],
stdout=bios_fh)
self.vm.set_console()
self.vm.add_args('-bios', bios)
self.vm.launch()
wait_for_console_pattern(self, 'FLASH:')
if __name__ == '__main__':
QemuSystemTest.main()