1*a44b318fSThomas Huth#!/usr/bin/env python3 2*a44b318fSThomas Huth# 3*a44b318fSThomas Huth# Functional test that boots a Linux kernel and checks the console 4*a44b318fSThomas Huth# 5*a44b318fSThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later 6*a44b318fSThomas Huth 7*a44b318fSThomas Huthfrom qemu_test import LinuxKernelTest, Asset 8*a44b318fSThomas Huth 9*a44b318fSThomas Huthclass ArmVirtMachine(LinuxKernelTest): 10*a44b318fSThomas Huth 11*a44b318fSThomas Huth ASSET_KERNEL = Asset( 12*a44b318fSThomas Huth ('https://archives.fedoraproject.org/pub/archive/fedora/linux/' 13*a44b318fSThomas Huth 'releases/29/Everything/armhfp/os/images/pxeboot/vmlinuz'), 14*a44b318fSThomas Huth '18dd5f1a9a28bd539f9d047f7c0677211bae528e8712b40ca5a229a4ad8e2591') 15*a44b318fSThomas Huth 16*a44b318fSThomas Huth def test_arm_virt(self): 17*a44b318fSThomas Huth self.set_machine('virt') 18*a44b318fSThomas Huth kernel_path = self.ASSET_KERNEL.fetch() 19*a44b318fSThomas Huth 20*a44b318fSThomas Huth self.vm.set_console() 21*a44b318fSThomas Huth kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 22*a44b318fSThomas Huth 'console=ttyAMA0') 23*a44b318fSThomas Huth self.vm.add_args('-kernel', kernel_path, 24*a44b318fSThomas Huth '-append', kernel_command_line) 25*a44b318fSThomas Huth self.vm.launch() 26*a44b318fSThomas Huth console_pattern = 'Kernel command line: %s' % kernel_command_line 27*a44b318fSThomas Huth self.wait_for_console_pattern(console_pattern) 28*a44b318fSThomas Huth 29*a44b318fSThomas Huthif __name__ == '__main__': 30*a44b318fSThomas Huth LinuxKernelTest.main() 31