Philippe Mathieu-Daudé | 71b290e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 1 | # Functional test that boots a PReP/40p machine and checks its serial console. |
| 2 | # |
| 3 | # Copyright (c) Philippe Mathieu-Daudé <f4bug@amsat.org> |
| 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 | |
| 8 | import os |
| 9 | |
| 10 | from avocado import skipIf |
| 11 | from avocado import skipUnless |
| 12 | from avocado_qemu import Test |
| 13 | from avocado_qemu import wait_for_console_pattern |
| 14 | |
| 15 | |
| 16 | class IbmPrep40pMachine(Test): |
| 17 | |
| 18 | timeout = 60 |
| 19 | |
| 20 | # 12H0455 PPS Firmware Licensed Materials |
| 21 | # Property of IBM (C) Copyright IBM Corp. 1994. |
| 22 | # All rights reserved. |
| 23 | # U.S. Government Users Restricted Rights - Use, duplication or disclosure |
| 24 | # restricted by GSA ADP Schedule Contract with IBM Corp. |
Philippe Mathieu-Daudé | 71b290e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 25 | @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') |
| 26 | def test_factory_firmware_and_netbsd(self): |
| 27 | """ |
| 28 | :avocado: tags=arch:ppc |
| 29 | :avocado: tags=machine:40p |
Philippe Mathieu-Daudé | 012293c | 2021-06-23 20:00:15 +0200 | [diff] [blame] | 30 | :avocado: tags=os:netbsd |
Philippe Mathieu-Daudé | 71b290e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 31 | :avocado: tags=slowness:high |
| 32 | """ |
Philippe Mathieu-Daudé | b131b49 | 2020-04-03 15:05:07 +0200 | [diff] [blame] | 33 | bios_url = ('http://ftpmirror.your.org/pub/misc/' |
| 34 | 'ftp.software.ibm.com/rs6000/firmware/' |
Philippe Mathieu-Daudé | 71b290e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 35 | '7020-40p/P12H0456.IMG') |
| 36 | bios_hash = '1775face4e6dc27f3a6ed955ef6eb331bf817f03' |
| 37 | bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash) |
Thomas Huth | a60f755 | 2020-10-22 16:19:00 +0200 | [diff] [blame] | 38 | drive_url = ('https://archive.netbsd.org/pub/NetBSD-archive/' |
Philippe Mathieu-Daudé | 71b290e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 39 | 'NetBSD-4.0/prep/installation/floppy/generic_com0.fs') |
| 40 | drive_hash = 'dbcfc09912e71bd5f0d82c7c1ee43082fb596ceb' |
| 41 | drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash) |
| 42 | |
Philippe Mathieu-Daudé | 71b290e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 43 | self.vm.set_console() |
| 44 | self.vm.add_args('-bios', bios_path, |
| 45 | '-fda', drive_path) |
| 46 | self.vm.launch() |
| 47 | os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007' |
| 48 | wait_for_console_pattern(self, os_banner) |
| 49 | wait_for_console_pattern(self, 'Model: IBM PPS Model 6015') |
Philippe Mathieu-Daudé | 1a9559e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 50 | |
| 51 | def test_openbios_192m(self): |
| 52 | """ |
| 53 | :avocado: tags=arch:ppc |
| 54 | :avocado: tags=machine:40p |
| 55 | """ |
Philippe Mathieu-Daudé | 1a9559e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 56 | self.vm.set_console() |
| 57 | self.vm.add_args('-m', '192') # test fw_cfg |
| 58 | |
| 59 | self.vm.launch() |
| 60 | wait_for_console_pattern(self, '>> OpenBIOS') |
| 61 | wait_for_console_pattern(self, '>> Memory: 192M') |
| 62 | wait_for_console_pattern(self, '>> CPU type PowerPC,604') |
| 63 | |
Philippe Mathieu-Daudé | 1a9559e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 64 | def test_openbios_and_netbsd(self): |
| 65 | """ |
| 66 | :avocado: tags=arch:ppc |
| 67 | :avocado: tags=machine:40p |
Philippe Mathieu-Daudé | 012293c | 2021-06-23 20:00:15 +0200 | [diff] [blame] | 68 | :avocado: tags=os:netbsd |
Philippe Mathieu-Daudé | 1a9559e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 69 | """ |
Philippe Mathieu-Daudé | 5cf67ac | 2020-02-11 14:45:04 +0100 | [diff] [blame] | 70 | drive_url = ('https://cdn.netbsd.org/pub/NetBSD/iso/7.1.2/' |
Philippe Mathieu-Daudé | 1a9559e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 71 | 'NetBSD-7.1.2-prep.iso') |
| 72 | drive_hash = 'ac6fa2707d888b36d6fa64de6e7fe48e' |
| 73 | drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash, |
| 74 | algorithm='md5') |
Philippe Mathieu-Daudé | 1a9559e | 2019-10-28 19:04:04 -0400 | [diff] [blame] | 75 | self.vm.set_console() |
| 76 | self.vm.add_args('-cdrom', drive_path, |
| 77 | '-boot', 'd') |
| 78 | |
| 79 | self.vm.launch() |
| 80 | wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9') |