master
py 37 lines 1.34 KB
Raw
1 #!/usr/bin/env python3
2 #
3 # Functional test that boots an AArch32 Linux kernel and checks the console
4 # on a TCG aarch64 CPU with aarch64=off. This is the same image etc
5 # as we use in tests/functional/arm/test_virt.py.
6 #
7 # SPDX-License-Identifier: GPL-2.0-or-later
8
9 from qemu_test import LinuxKernelTest, Asset
10
11 class ArmVirtMachine(LinuxKernelTest):
12
13 ASSET_KERNEL = Asset(
14 ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
15 'releases/29/Everything/armhfp/os/images/pxeboot/vmlinuz'),
16 '18dd5f1a9a28bd539f9d047f7c0677211bae528e8712b40ca5a229a4ad8e2591')
17
18 def test_arm_virt(self):
19 self.set_machine('virt')
20 # KVM aarch64=off requires a host CPU that supports it, so
21 # restrict the test to TCG ARMv8.
22 self.require_accelerator('tcg')
23 self.vm.add_args('-cpu', 'max-v8,aarch64=off')
24
25 kernel_path = self.ASSET_KERNEL.fetch()
26
27 self.vm.set_console()
28 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
29 'console=ttyAMA0')
30 self.vm.add_args('-kernel', kernel_path,
31 '-append', kernel_command_line)
32 self.vm.launch()
33 console_pattern = 'Kernel command line: %s' % kernel_command_line
34 self.wait_for_console_pattern(console_pattern)
35
36 if __name__ == '__main__':
37 LinuxKernelTest.main()