From: "Alex Bennée" <alex.bennee@linaro.org> To: qemu-devel@nongnu.org Cc: julien@xen.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, "Wainer dos Santos Moschetta" <wainersm@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, "Cleber Rosa" <crosa@redhat.com>, xen-devel@lists.xenproject.org, stefano.stabellini@xilinx.com, "Alex Bennée" <alex.bennee@linaro.org>, stratos-dev@op-lists.linaro.org Subject: [PATCH v2 7/7] tests/avocado: add boot_xen tests Date: Thu, 11 Feb 2021 17:19:45 +0000 [thread overview] Message-ID: <20210211171945.18313-8-alex.bennee@linaro.org> (raw) In-Reply-To: <20210211171945.18313-1-alex.bennee@linaro.org> These tests make sure we can boot the Xen hypervisor with a Dom0 kernel using the guest-loader. We currently have to use a kernel I built myself because there are issues using the Debian kernel images. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- MAINTAINERS | 1 + tests/acceptance/boot_xen.py | 117 +++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 tests/acceptance/boot_xen.py diff --git a/MAINTAINERS b/MAINTAINERS index 853f174fcf..537ca7a6f3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1998,6 +1998,7 @@ M: Alex Bennée <alex.bennee@linaro.org> S: Maintained F: hw/core/guest-loader.c F: docs/system/guest-loader.rst +F: tests/acceptance/boot_xen.py Intel Hexadecimal Object File Loader M: Su Hang <suhang16@mails.ucas.ac.cn> diff --git a/tests/acceptance/boot_xen.py b/tests/acceptance/boot_xen.py new file mode 100644 index 0000000000..8c7e091d40 --- /dev/null +++ b/tests/acceptance/boot_xen.py @@ -0,0 +1,117 @@ +# Functional test that boots a Xen hypervisor with a domU kernel and +# checks the console output is vaguely sane . +# +# Copyright (c) 2020 Linaro +# +# Author: +# Alex Bennée <alex.bennee@linaro.org> +# +# SPDX-License-Identifier: GPL-2.0-or-later +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import os + +from avocado import skipIf +from avocado_qemu import wait_for_console_pattern +from boot_linux_console import LinuxKernelTest + + +class BootXenBase(LinuxKernelTest): + """ + Boots a Xen hypervisor with a Linux DomU kernel. + """ + + timeout = 90 + XEN_COMMON_COMMAND_LINE = 'dom0_mem=128M loglvl=all guest_loglvl=all' + + def fetch_guest_kernel(self): + # Using my own built kernel - which works + kernel_url = ('https://fileserver.linaro.org/' + 's/JSsewXGZ6mqxPr5/download?path=%2F&files=' + 'linux-5.9.9-arm64-ajb') + kernel_sha1 = '4f92bc4b9f88d5ab792fa7a43a68555d344e1b83' + kernel_path = self.fetch_asset(kernel_url, + asset_hash=kernel_sha1) + + return kernel_path + + def launch_xen(self, xen_path): + """ + Launch Xen with a dom0 guest kernel + """ + self.log.info("launch with xen_path: %s", xen_path) + kernel_path = self.fetch_guest_kernel() + + self.vm.set_console() + + xen_command_line = self.XEN_COMMON_COMMAND_LINE + self.vm.add_args('-machine', 'virtualization=on', + '-cpu', 'cortex-a57', + '-m', '768', + '-kernel', xen_path, + '-append', xen_command_line, + '-device', + "guest-loader,addr=0x47000000,kernel=%s,bootargs=console=hvc0" + % (kernel_path)) + + self.vm.launch() + + console_pattern = 'VFS: Cannot open root device' + wait_for_console_pattern(self, console_pattern, "Panic on CPU 0:") + + +class BootXen(BootXenBase): + + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') + def test_arm64_xen_411_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + xen_url = ('https://deb.debian.org/debian/' + 'pool/main/x/xen/' + 'xen-hypervisor-4.11-arm64_4.11.4+37-g3263f257ca-1_arm64.deb') + xen_sha1 = '034e634d4416adbad1212d59b62bccdcda63e62a' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.11-arm64") + + self.launch_xen(xen_path) + + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') + def test_arm64_xen_414_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + xen_url = ('https://deb.debian.org/debian/' + 'pool/main/x/xen/' + 'xen-hypervisor-4.14-arm64_4.14.0+80-gd101b417b7-1_arm64.deb') + xen_sha1 = 'b9d209dd689ed2b393e625303a225badefec1160' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.14-arm64") + + self.launch_xen(xen_path) + + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') + def test_arm64_xen_415_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + + xen_url = ('https://fileserver.linaro.org/' + 's/JSsewXGZ6mqxPr5/download' + '?path=%2F&files=xen-upstream-4.15-unstable.deb') + xen_sha1 = 'fc191172b85cf355abb95d275a24cc0f6d6579d8' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.15-unstable") + + self.launch_xen(xen_path) -- 2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org> To: qemu-devel@nongnu.org Cc: julien@xen.org, stefano.stabellini@linaro.org, stefano.stabellini@xilinx.com, andre.przywara@arm.com, stratos-dev@op-lists.linaro.org, xen-devel@lists.xenproject.org, "Alex Bennée" <alex.bennee@linaro.org>, "Cleber Rosa" <crosa@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, "Wainer dos Santos Moschetta" <wainersm@redhat.com> Subject: [PATCH v2 7/7] tests/avocado: add boot_xen tests Date: Thu, 11 Feb 2021 17:19:45 +0000 [thread overview] Message-ID: <20210211171945.18313-8-alex.bennee@linaro.org> (raw) In-Reply-To: <20210211171945.18313-1-alex.bennee@linaro.org> These tests make sure we can boot the Xen hypervisor with a Dom0 kernel using the guest-loader. We currently have to use a kernel I built myself because there are issues using the Debian kernel images. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- MAINTAINERS | 1 + tests/acceptance/boot_xen.py | 117 +++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 tests/acceptance/boot_xen.py diff --git a/MAINTAINERS b/MAINTAINERS index 853f174fcf..537ca7a6f3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1998,6 +1998,7 @@ M: Alex Bennée <alex.bennee@linaro.org> S: Maintained F: hw/core/guest-loader.c F: docs/system/guest-loader.rst +F: tests/acceptance/boot_xen.py Intel Hexadecimal Object File Loader M: Su Hang <suhang16@mails.ucas.ac.cn> diff --git a/tests/acceptance/boot_xen.py b/tests/acceptance/boot_xen.py new file mode 100644 index 0000000000..8c7e091d40 --- /dev/null +++ b/tests/acceptance/boot_xen.py @@ -0,0 +1,117 @@ +# Functional test that boots a Xen hypervisor with a domU kernel and +# checks the console output is vaguely sane . +# +# Copyright (c) 2020 Linaro +# +# Author: +# Alex Bennée <alex.bennee@linaro.org> +# +# SPDX-License-Identifier: GPL-2.0-or-later +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import os + +from avocado import skipIf +from avocado_qemu import wait_for_console_pattern +from boot_linux_console import LinuxKernelTest + + +class BootXenBase(LinuxKernelTest): + """ + Boots a Xen hypervisor with a Linux DomU kernel. + """ + + timeout = 90 + XEN_COMMON_COMMAND_LINE = 'dom0_mem=128M loglvl=all guest_loglvl=all' + + def fetch_guest_kernel(self): + # Using my own built kernel - which works + kernel_url = ('https://fileserver.linaro.org/' + 's/JSsewXGZ6mqxPr5/download?path=%2F&files=' + 'linux-5.9.9-arm64-ajb') + kernel_sha1 = '4f92bc4b9f88d5ab792fa7a43a68555d344e1b83' + kernel_path = self.fetch_asset(kernel_url, + asset_hash=kernel_sha1) + + return kernel_path + + def launch_xen(self, xen_path): + """ + Launch Xen with a dom0 guest kernel + """ + self.log.info("launch with xen_path: %s", xen_path) + kernel_path = self.fetch_guest_kernel() + + self.vm.set_console() + + xen_command_line = self.XEN_COMMON_COMMAND_LINE + self.vm.add_args('-machine', 'virtualization=on', + '-cpu', 'cortex-a57', + '-m', '768', + '-kernel', xen_path, + '-append', xen_command_line, + '-device', + "guest-loader,addr=0x47000000,kernel=%s,bootargs=console=hvc0" + % (kernel_path)) + + self.vm.launch() + + console_pattern = 'VFS: Cannot open root device' + wait_for_console_pattern(self, console_pattern, "Panic on CPU 0:") + + +class BootXen(BootXenBase): + + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') + def test_arm64_xen_411_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + xen_url = ('https://deb.debian.org/debian/' + 'pool/main/x/xen/' + 'xen-hypervisor-4.11-arm64_4.11.4+37-g3263f257ca-1_arm64.deb') + xen_sha1 = '034e634d4416adbad1212d59b62bccdcda63e62a' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.11-arm64") + + self.launch_xen(xen_path) + + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') + def test_arm64_xen_414_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + xen_url = ('https://deb.debian.org/debian/' + 'pool/main/x/xen/' + 'xen-hypervisor-4.14-arm64_4.14.0+80-gd101b417b7-1_arm64.deb') + xen_sha1 = 'b9d209dd689ed2b393e625303a225badefec1160' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.14-arm64") + + self.launch_xen(xen_path) + + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') + def test_arm64_xen_415_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + + xen_url = ('https://fileserver.linaro.org/' + 's/JSsewXGZ6mqxPr5/download' + '?path=%2F&files=xen-upstream-4.15-unstable.deb') + xen_sha1 = 'fc191172b85cf355abb95d275a24cc0f6d6579d8' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.15-unstable") + + self.launch_xen(xen_path) -- 2.20.1
next prev parent reply other threads:[~2021-02-11 17:32 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-11 17:19 [PATCH v2 0/7] Xen guest loader (to boot Xen+Kernel under TCG) Alex Bennée 2021-02-11 17:19 ` Alex Bennée 2021-02-11 17:19 ` [PATCH v2 1/7] hw/board: promote fdt from ARM VirtMachineState to MachineState Alex Bennée 2021-02-11 17:19 ` Alex Bennée 2021-02-11 17:40 ` Peter Maydell 2021-02-11 17:40 ` Peter Maydell 2021-02-11 17:19 ` [PATCH v2 2/7] hw/riscv: migrate fdt field to generic MachineState Alex Bennée 2021-02-11 17:19 ` Alex Bennée 2021-02-11 17:19 ` [PATCH v2 3/7] device_tree: add qemu_fdt_setprop_string_array helper Alex Bennée 2021-02-11 17:19 ` Alex Bennée 2021-02-17 0:44 ` David Gibson 2021-02-17 0:44 ` David Gibson 2021-02-11 17:19 ` [PATCH v2 4/7] hw/core: implement a guest-loader to support static hypervisor guests Alex Bennée 2021-02-11 17:19 ` Alex Bennée 2021-02-11 17:19 ` [PATCH v2 5/7] docs: move generic-loader documentation into the main manual Alex Bennée 2021-02-11 17:19 ` Alex Bennée 2021-02-12 21:38 ` Alistair Francis 2021-02-12 21:38 ` Alistair Francis 2021-02-11 17:19 ` [PATCH v2 6/7] docs: add some documentation for the guest-loader Alex Bennée 2021-02-11 17:19 ` Alex Bennée 2021-02-12 21:39 ` Alistair Francis 2021-02-12 21:39 ` Alistair Francis 2021-02-11 17:19 ` Alex Bennée [this message] 2021-02-11 17:19 ` [PATCH v2 7/7] tests/avocado: add boot_xen tests Alex Bennée 2021-02-17 14:31 ` Philippe Mathieu-Daudé 2021-02-17 14:31 ` Philippe Mathieu-Daudé 2021-02-17 20:46 ` Cleber Rosa 2021-02-17 20:46 ` Cleber Rosa 2021-02-17 22:22 ` Alex Bennée 2021-02-17 22:22 ` Alex Bennée 2021-02-18 15:15 ` Cleber Rosa 2021-02-18 15:15 ` Cleber Rosa 2021-02-18 9:43 ` Philippe Mathieu-Daudé 2021-02-18 9:43 ` Philippe Mathieu-Daudé 2021-02-18 15:22 ` Cleber Rosa 2021-02-18 15:22 ` Cleber Rosa 2021-02-25 13:09 ` [PATCH v2 0/7] Xen guest loader (to boot Xen+Kernel under TCG) Alex Bennée 2021-02-25 13:09 ` Alex Bennée
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210211171945.18313-8-alex.bennee@linaro.org \ --to=alex.bennee@linaro.org \ --cc=andre.przywara@arm.com \ --cc=crosa@redhat.com \ --cc=julien@xen.org \ --cc=philmd@redhat.com \ --cc=qemu-devel@nongnu.org \ --cc=stefano.stabellini@linaro.org \ --cc=stefano.stabellini@xilinx.com \ --cc=stratos-dev@op-lists.linaro.org \ --cc=wainersm@redhat.com \ --cc=xen-devel@lists.xenproject.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.