Upstream: https://gitlab.com/qemu-project/qemu.git Upstream-Commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
38 lines
1.3 KiB
Python
Executable File
38 lines
1.3 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
#
|
|
# Functional test that boots an AArch32 Linux kernel and checks the console
|
|
# on a TCG aarch64 CPU with aarch64=off. This is the same image etc
|
|
# as we use in tests/functional/arm/test_virt.py.
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
from qemu_test import LinuxKernelTest, Asset
|
|
|
|
class ArmVirtMachine(LinuxKernelTest):
|
|
|
|
ASSET_KERNEL = Asset(
|
|
('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
|
|
'releases/29/Everything/armhfp/os/images/pxeboot/vmlinuz'),
|
|
'18dd5f1a9a28bd539f9d047f7c0677211bae528e8712b40ca5a229a4ad8e2591')
|
|
|
|
def test_arm_virt(self):
|
|
self.set_machine('virt')
|
|
# KVM aarch64=off requires a host CPU that supports it, so
|
|
# restrict the test to TCG only
|
|
self.require_accelerator('tcg')
|
|
self.vm.add_args('-cpu', 'max,aarch64=off')
|
|
|
|
kernel_path = self.ASSET_KERNEL.fetch()
|
|
|
|
self.vm.set_console()
|
|
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
|
'console=ttyAMA0')
|
|
self.vm.add_args('-kernel', kernel_path,
|
|
'-append', kernel_command_line)
|
|
self.vm.launch()
|
|
console_pattern = 'Kernel command line: %s' % kernel_command_line
|
|
self.wait_for_console_pattern(console_pattern)
|
|
|
|
if __name__ == '__main__':
|
|
LinuxKernelTest.main()
|