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