1*221620b7SThomas Huth#!/usr/bin/env python3 2*221620b7SThomas Huth# 3*221620b7SThomas Huth# Replay test that boots a Linux kernel on ppc64 machines 4*221620b7SThomas Huth# and checks the console 5*221620b7SThomas Huth# 6*221620b7SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later 7*221620b7SThomas Huth 8*221620b7SThomas Huthfrom qemu_test import Asset 9*221620b7SThomas Huthfrom replay_kernel import ReplayKernelBase 10*221620b7SThomas Huth 11*221620b7SThomas Huth 12*221620b7SThomas Huthclass Ppc64Replay(ReplayKernelBase): 13*221620b7SThomas Huth 14*221620b7SThomas Huth ASSET_DAY19 = Asset( 15*221620b7SThomas Huth ('https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/' 16*221620b7SThomas Huth 'day19.tar.xz'), 17*221620b7SThomas Huth '20b1bb5a8488c664defbb5d283addc91a05335a936c63b3f5ff7eee74b725755') 18*221620b7SThomas Huth 19*221620b7SThomas Huth def test_ppc64_e500(self): 20*221620b7SThomas Huth self.set_machine('ppce500') 21*221620b7SThomas Huth self.cpu = 'e5500' 22*221620b7SThomas Huth kernel_path = self.archive_extract(self.ASSET_DAY19, 23*221620b7SThomas Huth member='day19/uImage') 24*221620b7SThomas Huth self.run_rr(kernel_path, self.REPLAY_KERNEL_COMMAND_LINE, 25*221620b7SThomas Huth 'QEMU advent calendar') 26*221620b7SThomas Huth 27*221620b7SThomas Huth ASSET_KERNEL = Asset( 28*221620b7SThomas Huth ('https://archives.fedoraproject.org/pub/archive/fedora-secondary/' 29*221620b7SThomas Huth 'releases/29/Everything/ppc64le/os/ppc/ppc64/vmlinuz'), 30*221620b7SThomas Huth '383c2f5c23bc0d9d32680c3924d3fd7ee25cc5ef97091ac1aa5e1d853422fc5f') 31*221620b7SThomas Huth 32*221620b7SThomas Huth def test_ppc64_pseries(self): 33*221620b7SThomas Huth self.set_machine('pseries') 34*221620b7SThomas Huth kernel_path = self.ASSET_KERNEL.fetch() 35*221620b7SThomas Huth kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0' 36*221620b7SThomas Huth console_pattern = 'VFS: Cannot open root device' 37*221620b7SThomas Huth self.run_rr(kernel_path, kernel_command_line, console_pattern) 38*221620b7SThomas Huth 39*221620b7SThomas Huth def test_ppc64_powernv(self): 40*221620b7SThomas Huth self.set_machine('powernv') 41*221620b7SThomas Huth kernel_path = self.ASSET_KERNEL.fetch() 42*221620b7SThomas Huth kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + \ 43*221620b7SThomas Huth 'console=tty0 console=hvc0' 44*221620b7SThomas Huth console_pattern = 'VFS: Cannot open root device' 45*221620b7SThomas Huth self.run_rr(kernel_path, kernel_command_line, console_pattern) 46*221620b7SThomas Huth 47*221620b7SThomas Huth 48*221620b7SThomas Huthif __name__ == '__main__': 49*221620b7SThomas Huth ReplayKernelBase.main() 50