| 1 | #!/usr/bin/env python3 |
| 2 | # |
| 3 | # Replay tests for the big-endian 32-bit MIPS Malta board |
| 4 | # |
| 5 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 6 | |
| 7 | from qemu_test import Asset, skipSlowTest |
| 8 | from qemu_test import skipFlakyTest |
| 9 | from replay_kernel import ReplayKernelBase |
| 10 | |
| 11 | |
| 12 | class MipsReplay(ReplayKernelBase): |
| 13 | |
| 14 | ASSET_KERNEL_2_63_2 = Asset( |
| 15 | ('http://snapshot.debian.org/archive/debian/' |
| 16 | '20130217T032700Z/pool/main/l/linux-2.6/' |
| 17 | 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb'), |
| 18 | '16ca524148afb0626f483163e5edf352bc1ab0e4fc7b9f9d473252762f2c7a43') |
| 19 | |
| 20 | @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/2013") |
| 21 | def test_replay_mips_malta(self): |
| 22 | self.set_machine('malta') |
| 23 | kernel_path = self.archive_extract(self.ASSET_KERNEL_2_63_2, |
| 24 | member='boot/vmlinux-2.6.32-5-4kc-malta') |
| 25 | kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' |
| 26 | console_pattern = 'Kernel command line: %s' % kernel_command_line |
| 27 | self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5) |
| 28 | |
| 29 | ASSET_KERNEL_4_5_0 = Asset( |
| 30 | ('http://snapshot.debian.org/archive/debian/' |
| 31 | '20160601T041800Z/pool/main/l/linux/' |
| 32 | 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb'), |
| 33 | '526b17d5889840888b76fc2c36a0ebde182c9b1410a3a1e68203c3b160eb2027') |
| 34 | |
| 35 | ASSET_INITRD = Asset( |
| 36 | ('https://github.com/groeck/linux-build-test/raw/' |
| 37 | '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/' |
| 38 | 'mips/rootfs.cpio.gz'), |
| 39 | 'dcfe3a7fe3200da3a00d176b95caaa086495eb158f2bff64afc67d7e1eb2cddc') |
| 40 | |
| 41 | @skipSlowTest() |
| 42 | def test_replay_mips_malta_cpio(self): |
| 43 | self.set_machine('malta') |
| 44 | kernel_path = self.archive_extract(self.ASSET_KERNEL_4_5_0, |
| 45 | member='boot/vmlinux-4.5.0-2-4kc-malta') |
| 46 | initrd_path = self.uncompress(self.ASSET_INITRD) |
| 47 | |
| 48 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + |
| 49 | 'console=ttyS0 console=tty ' |
| 50 | 'rdinit=/sbin/init noreboot') |
| 51 | console_pattern = 'Boot successful.' |
| 52 | self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5, |
| 53 | args=('-initrd', initrd_path)) |
| 54 | |
| 55 | |
| 56 | if __name__ == '__main__': |
| 57 | ReplayKernelBase.main() |