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