master
py 69 lines 2.87 KB
Raw
1 #!/usr/bin/env python3
2 #
3 # Replay test that boots a Linux kernel on arm machines and checks the console
4 #
5 # SPDX-License-Identifier: GPL-2.0-or-later
6
7 from qemu_test import Asset
8 from replay_kernel import ReplayKernelBase
9
10
11 class ArmReplay(ReplayKernelBase):
12
13 ASSET_VIRT = Asset(
14 ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
15 'releases/29/Everything/armhfp/os/images/pxeboot/vmlinuz'),
16 '18dd5f1a9a28bd539f9d047f7c0677211bae528e8712b40ca5a229a4ad8e2591')
17
18 def test_virt(self):
19 self.set_machine('virt')
20 kernel_path = self.ASSET_VIRT.fetch()
21 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
22 'console=ttyAMA0')
23 console_pattern = 'VFS: Cannot open root device'
24 self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=1)
25
26 ASSET_CUBIE_KERNEL = Asset(
27 ('https://apt.armbian.com/pool/main/l/linux-6.6.16/'
28 'linux-image-current-sunxi_24.2.1_armhf_'
29 '_6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb'),
30 '3d968c15b121ede871dce49d13ee7644d6f74b6b121b84c9a40f51b0c80d6d22')
31
32 ASSET_CUBIE_INITRD = Asset(
33 ('https://github.com/groeck/linux-build-test/raw/'
34 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/arm/rootfs-armv5.cpio.gz'),
35 '334b8d256db67a3f2b3ad070aa08b5ade39624e0e7e35b02f4359a577bc8f39b')
36
37 def test_cubieboard(self):
38 self.set_machine('cubieboard')
39 kernel_path = self.archive_extract(self.ASSET_CUBIE_KERNEL,
40 member='boot/vmlinuz-6.6.16-current-sunxi')
41 dtb_path = self.archive_extract(self.ASSET_CUBIE_KERNEL,
42 member='usr/lib/linux-image-6.6.16-current-sunxi/sun4i-a10-cubieboard.dtb')
43 initrd_path = self.uncompress(self.ASSET_CUBIE_INITRD)
44
45 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
46 'console=ttyS0,115200 '
47 'usbcore.nousb '
48 'panic=-1 noreboot')
49 console_pattern = 'Boot successful.'
50 self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=1,
51 args=('-dtb', dtb_path,
52 '-initrd', initrd_path,
53 '-no-reboot'))
54
55 ASSET_DAY16 = Asset(
56 'https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day16.tar.xz',
57 '63311adb2d4c4e7a73214a86d29988add87266a909719c56acfadd026b4110a7')
58
59 def test_vexpressa9(self):
60 self.set_machine('vexpress-a9')
61 self.archive_extract(self.ASSET_DAY16)
62 kernel_path = self.scratch_file('day16', 'winter.zImage')
63 dtb_path = self.scratch_file('day16', 'vexpress-v2p-ca9.dtb')
64 self.run_rr(kernel_path, self.REPLAY_KERNEL_COMMAND_LINE,
65 'QEMU advent calendar', args=('-dtb', dtb_path))
66
67
68 if __name__ == '__main__':
69 ReplayKernelBase.main()