Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[qemu/ar7.git] / tests / acceptance / boot_xen.py
blob75c2d44492bcea240d78477263a04677b2d0a441
1 # Functional test that boots a Xen hypervisor with a domU kernel and
2 # checks the console output is vaguely sane .
4 # Copyright (c) 2020 Linaro
6 # Author:
7 # Alex Bennée <alex.bennee@linaro.org>
9 # SPDX-License-Identifier: GPL-2.0-or-later
11 # This work is licensed under the terms of the GNU GPL, version 2 or
12 # later. See the COPYING file in the top-level directory.
14 import os
16 from avocado import skipIf
17 from avocado_qemu import wait_for_console_pattern
18 from boot_linux_console import LinuxKernelTest
21 class BootXenBase(LinuxKernelTest):
22 """
23 Boots a Xen hypervisor with a Linux DomU kernel.
24 """
26 timeout = 90
27 XEN_COMMON_COMMAND_LINE = 'dom0_mem=128M loglvl=all guest_loglvl=all'
29 def fetch_guest_kernel(self):
30 # Using my own built kernel - which works
31 kernel_url = ('https://fileserver.linaro.org/'
32 's/JSsewXGZ6mqxPr5/download?path=%2F&files='
33 'linux-5.9.9-arm64-ajb')
34 kernel_sha1 = '4f92bc4b9f88d5ab792fa7a43a68555d344e1b83'
35 kernel_path = self.fetch_asset(kernel_url,
36 asset_hash=kernel_sha1)
38 return kernel_path
40 def launch_xen(self, xen_path):
41 """
42 Launch Xen with a dom0 guest kernel
43 """
44 self.log.info("launch with xen_path: %s", xen_path)
45 kernel_path = self.fetch_guest_kernel()
47 self.vm.set_console()
49 xen_command_line = self.XEN_COMMON_COMMAND_LINE
50 self.vm.add_args('-machine', 'virtualization=on',
51 '-cpu', 'cortex-a57',
52 '-m', '768',
53 '-kernel', xen_path,
54 '-append', xen_command_line,
55 '-device',
56 'guest-loader,addr=0x47000000,kernel=%s,bootargs=console=hvc0'
57 % (kernel_path))
59 self.vm.launch()
61 console_pattern = 'VFS: Cannot open root device'
62 wait_for_console_pattern(self, console_pattern, "Panic on CPU 0:")
65 class BootXen(BootXenBase):
67 def test_arm64_xen_411_and_dom0(self):
68 """
69 :avocado: tags=arch:aarch64
70 :avocado: tags=accel:tcg
71 :avocado: tags=cpu:cortex-a57
72 :avocado: tags=machine:virt
73 """
75 # archive of file from https://deb.debian.org/debian/pool/main/x/xen/
76 xen_url = ('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/'
77 'download?path=%2F&files='
78 'xen-hypervisor-4.11-arm64_4.11.4%2B37-g3263f257ca-1_arm64.deb')
79 xen_sha1 = '034e634d4416adbad1212d59b62bccdcda63e62a'
80 xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1)
81 xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.11-arm64")
83 self.launch_xen(xen_path)
85 def test_arm64_xen_414_and_dom0(self):
86 """
87 :avocado: tags=arch:aarch64
88 :avocado: tags=accel:tcg
89 :avocado: tags=cpu:cortex-a57
90 :avocado: tags=machine:virt
91 """
93 # archive of file from https://deb.debian.org/debian/pool/main/x/xen/
94 xen_url = ('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/'
95 'download?path=%2F&files='
96 'xen-hypervisor-4.14-arm64_4.14.0%2B80-gd101b417b7-1_arm64.deb')
97 xen_sha1 = 'b9d209dd689ed2b393e625303a225badefec1160'
98 xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1)
99 xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.14-arm64")
101 self.launch_xen(xen_path)
103 def test_arm64_xen_415_and_dom0(self):
105 :avocado: tags=arch:aarch64
106 :avocado: tags=accel:tcg
107 :avocado: tags=cpu:cortex-a57
108 :avocado: tags=machine:virt
111 xen_url = ('https://fileserver.linaro.org/'
112 's/JSsewXGZ6mqxPr5/download'
113 '?path=%2F&files=xen-upstream-4.15-unstable.deb')
114 xen_sha1 = 'fc191172b85cf355abb95d275a24cc0f6d6579d8'
115 xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1)
116 xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.15-unstable")
118 self.launch_xen(xen_path)