| 1 | #!/usr/bin/env python3 |
| 2 | # |
| 3 | # Test that OpenBSD boots on a ppc powernv machine and reaches the installer. |
| 4 | # |
| 5 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 6 | |
| 7 | from qemu_test import QemuSystemTest, Asset |
| 8 | from qemu_test import wait_for_console_pattern |
| 9 | |
| 10 | |
| 11 | class OpenBSDPowerNV(QemuSystemTest): |
| 12 | |
| 13 | ASSET_MINIROOT = Asset( |
| 14 | 'https://kirill.korins.ky/pub/qemu-powerpc64-openbsd/miniroot79.img', |
| 15 | '7829e42b75d81cafd732038b9d63228b79c1f5828d8375872a4bb655e1d6b13c') |
| 16 | |
| 17 | ASSET_BOOTKERNEL = Asset( |
| 18 | 'https://kirill.korins.ky/pub/qemu-powerpc64-openbsd/pnor.BOOTKERNEL', |
| 19 | '397ce43ce61910e1a2c4f13d301f957e61513a9ec5371bc3e87d3095411fae7b') |
| 20 | |
| 21 | def test_powernv9_openbsd_installer(self): |
| 22 | self.set_machine('powernv9') |
| 23 | self.require_accelerator('tcg') |
| 24 | |
| 25 | miniroot_path = self.ASSET_MINIROOT.fetch() |
| 26 | bootkernel_path = self.ASSET_BOOTKERNEL.fetch() |
| 27 | |
| 28 | self.vm.set_console() |
| 29 | self.vm.add_args('-cpu', 'power9', |
| 30 | '-accel', 'tcg,thread=single', |
| 31 | '-smp', '1,cores=1,threads=1', |
| 32 | '-m', '2g', |
| 33 | '-kernel', bootkernel_path, |
| 34 | '-device', |
| 35 | 'ich9-ahci,id=sata0,bus=pcie.0,addr=0x0', |
| 36 | '-drive', |
| 37 | f'file={miniroot_path},format=raw,if=none,' |
| 38 | 'id=bootdisk,snapshot=on', |
| 39 | '-device', |
| 40 | 'ide-hd,bus=sata0.0,unit=0,drive=bootdisk,' |
| 41 | 'bootindex=1') |
| 42 | self.vm.launch() |
| 43 | |
| 44 | wait_for_console_pattern(self, 'OpenBSD 7.9 (RAMDISK)', 'panic:') |
| 45 | wait_for_console_pattern( |
| 46 | self, |
| 47 | '(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?', |
| 48 | 'panic:') |
| 49 | |
| 50 | |
| 51 | if __name__ == '__main__': |
| 52 | QemuSystemTest.main() |