1#!/usr/bin/env python3 2# 3# Replay tests for the little-endian 64-bit MIPS Malta board 4# 5# SPDX-License-Identifier: GPL-2.0-or-later 6 7import os 8import logging 9 10from qemu_test import Asset, exec_command_and_wait_for_pattern 11from qemu_test import skipIfMissingImports, skipFlakyTest, skipUntrustedTest 12from replay_kernel import ReplayKernelBase 13 14 15class Mips64elReplay(ReplayKernelBase): 16 17 ASSET_KERNEL_2_63_2 = Asset( 18 ('http://snapshot.debian.org/archive/debian/' 19 '20130217T032700Z/pool/main/l/linux-2.6/' 20 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb'), 21 '35eb476f03be589824b0310358f1c447d85e645b88cbcd2ac02b97ef560f9f8d') 22 23 def test_replay_mips64el_malta(self): 24 self.set_machine('malta') 25 kernel_path = self.archive_extract(self.ASSET_KERNEL_2_63_2, 26 member='boot/vmlinux-2.6.32-5-5kc-malta') 27 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' 28 console_pattern = 'Kernel command line: %s' % kernel_command_line 29 self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5) 30 31 32 ASSET_KERNEL_3_19_3 = Asset( 33 ('https://github.com/philmd/qemu-testing-blob/' 34 'raw/9ad2df38/mips/malta/mips64el/' 35 'vmlinux-3.19.3.mtoman.20150408'), 36 '8d3beb003bc66051ead98e7172139017fcf9ce2172576541c57e86418dfa5ab8') 37 38 ASSET_CPIO_R1 = Asset( 39 ('https://github.com/groeck/linux-build-test/' 40 'raw/8584a59e/rootfs/mipsel64/' 41 'rootfs.mipsel64r1.cpio.gz'), 42 '75ba10cd35fb44e32948eeb26974f061b703c81c4ba2fab1ebcacf1d1bec3b61') 43 44 @skipUntrustedTest() 45 def test_replay_mips64el_malta_5KEc_cpio(self): 46 self.set_machine('malta') 47 self.cpu = '5KEc' 48 kernel_path = self.ASSET_KERNEL_3_19_3.fetch() 49 initrd_path = self.uncompress(self.ASSET_CPIO_R1) 50 51 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 52 'console=ttyS0 console=tty ' 53 'rdinit=/sbin/init noreboot') 54 console_pattern = 'Boot successful.' 55 self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5, 56 args=('-initrd', initrd_path)) 57 58 59if __name__ == '__main__': 60 ReplayKernelBase.main() 61