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