osdep: protect qemu/osdep.h with extern "C"
[qemu/ar7.git] / tests / acceptance / ppc_prep_40p.py
blob96ba13b8943315ae05a1469e0ba8f91e9f342c8f
1 # Functional test that boots a PReP/40p machine and checks its serial console.
3 # Copyright (c) Philippe Mathieu-Daudé <f4bug@amsat.org>
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.
8 import os
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
16 class IbmPrep40pMachine(Test):
18 timeout = 60
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.
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
30 :avocado: tags=slowness:high
31 """
32 bios_url = ('http://ftpmirror.your.org/pub/misc/'
33 'ftp.software.ibm.com/rs6000/firmware/'
34 '7020-40p/P12H0456.IMG')
35 bios_hash = '1775face4e6dc27f3a6ed955ef6eb331bf817f03'
36 bios_path = self.fetch_asset(bios_url, asset_hash=bios_hash)
37 drive_url = ('https://archive.netbsd.org/pub/NetBSD-archive/'
38 'NetBSD-4.0/prep/installation/floppy/generic_com0.fs')
39 drive_hash = 'dbcfc09912e71bd5f0d82c7c1ee43082fb596ceb'
40 drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash)
42 self.vm.set_console()
43 self.vm.add_args('-bios', bios_path,
44 '-fda', drive_path)
45 self.vm.launch()
46 os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
47 wait_for_console_pattern(self, os_banner)
48 wait_for_console_pattern(self, 'Model: IBM PPS Model 6015')
50 def test_openbios_192m(self):
51 """
52 :avocado: tags=arch:ppc
53 :avocado: tags=machine:40p
54 """
55 self.vm.set_console()
56 self.vm.add_args('-m', '192') # test fw_cfg
58 self.vm.launch()
59 wait_for_console_pattern(self, '>> OpenBIOS')
60 wait_for_console_pattern(self, '>> Memory: 192M')
61 wait_for_console_pattern(self, '>> CPU type PowerPC,604')
63 def test_openbios_and_netbsd(self):
64 """
65 :avocado: tags=arch:ppc
66 :avocado: tags=machine:40p
67 """
68 drive_url = ('https://cdn.netbsd.org/pub/NetBSD/iso/7.1.2/'
69 'NetBSD-7.1.2-prep.iso')
70 drive_hash = 'ac6fa2707d888b36d6fa64de6e7fe48e'
71 drive_path = self.fetch_asset(drive_url, asset_hash=drive_hash,
72 algorithm='md5')
73 self.vm.set_console()
74 self.vm.add_args('-cdrom', drive_path,
75 '-boot', 'd')
77 self.vm.launch()
78 wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9')