Browse Source
* Add a test for the sam460ex machine * Fix the broken FreeBSD CI job by updating it to the latest version -----BEGIN PGP SIGNATURE----- iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmerQmoRHHRodXRoQHJl ZGhhdC5jb20ACgkQLtnXdP5wLbUTeg/+OKvhapE34jUJTQhDkB0XFbFsdhKx/0Jq UDL435i49B/x68t4sogZrg1qdYHrwANiTwsH/g0llX31oguENLdidUkvS3PhFbMo QqxfjdlrLwOia1P3/KlWJ9KbxoXmXccDH+LoANoHzO0NPg21tLNPbUUexaouIAvc ynvQV/OPS5bQRJCrIFN6PbQ6lyYcTOuJJU7j5Vr6FcqKmg7OH9IBCXHmcyEIFCki Zh/99+IDQkdWWVVsRSkLEPmXGKI/EasPC2GMTQ0LvztkqFUpycufOaL3Qz06yqMP ZxfshsKfOGCMOMClePICPrck4uvhuMoeXszrjsCWArOYzumuN5al4MtXLJZLWs92 p+nk0XGQmxjdCHj2ip/lasdjwPd2L1pk4+MXHBUgrmwgDo6EUW55DJd/E8ORsEY9 yvV4CCL3nCX2PRO1eUgo5FPhQbwF2TgLQO6ut69yRsVzcXh2w/Thzc++eH/qhCYI fbZUoIySfCcNLzDK/E5H3YVSQHvkc8cE3ymkb1BAOepVkdadc2l0P0D4RmO0/Nxk vy30Ik5+bf6xsJjpiYFQi8NwGNUwZlDPqlWikVWotlOhobmOqVIlnCovQ06mnru3 wsneISRLctPMHjlU6u1iuDiO0LG1CUvXrbP01mDwgGXaYAWg7o2e7rlbrExDHzwu fRs2aYnR9oY= =K10z -----END PGP SIGNATURE----- Merge tag 'pull-request-2025-02-11' of https://gitlab.com/thuth/qemu into staging * Convert more avocado tests to the functional framework * Add a test for the sam460ex machine * Fix the broken FreeBSD CI job by updating it to the latest version # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmerQmoRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbUTeg/+OKvhapE34jUJTQhDkB0XFbFsdhKx/0Jq # UDL435i49B/x68t4sogZrg1qdYHrwANiTwsH/g0llX31oguENLdidUkvS3PhFbMo # QqxfjdlrLwOia1P3/KlWJ9KbxoXmXccDH+LoANoHzO0NPg21tLNPbUUexaouIAvc # ynvQV/OPS5bQRJCrIFN6PbQ6lyYcTOuJJU7j5Vr6FcqKmg7OH9IBCXHmcyEIFCki # Zh/99+IDQkdWWVVsRSkLEPmXGKI/EasPC2GMTQ0LvztkqFUpycufOaL3Qz06yqMP # ZxfshsKfOGCMOMClePICPrck4uvhuMoeXszrjsCWArOYzumuN5al4MtXLJZLWs92 # p+nk0XGQmxjdCHj2ip/lasdjwPd2L1pk4+MXHBUgrmwgDo6EUW55DJd/E8ORsEY9 # yvV4CCL3nCX2PRO1eUgo5FPhQbwF2TgLQO6ut69yRsVzcXh2w/Thzc++eH/qhCYI # fbZUoIySfCcNLzDK/E5H3YVSQHvkc8cE3ymkb1BAOepVkdadc2l0P0D4RmO0/Nxk # vy30Ik5+bf6xsJjpiYFQi8NwGNUwZlDPqlWikVWotlOhobmOqVIlnCovQ06mnru3 # wsneISRLctPMHjlU6u1iuDiO0LG1CUvXrbP01mDwgGXaYAWg7o2e7rlbrExDHzwu # fRs2aYnR9oY= # =K10z # -----END PGP SIGNATURE----- # gpg: Signature made Tue 11 Feb 2025 07:28:26 EST # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2025-02-11' of https://gitlab.com/thuth/qemu: gitlab-ci.d/cirrus: Update the FreeBSD job to v14.2 gitlab: use new(ish) cirrus-vars command for creating config gitlab: don't fail cirrus CI jobs when credits are exhausted tests/functional: Add a ppc sam460ex test tests/functional: Convert the hotplug_blk avocado test tests/functional/test_aarch64_virt: Fix vulkan test without egl-headless tests/functional: Convert the aarch64 xen test to the functional framework Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>pull/281/head
10 changed files with 228 additions and 187 deletions
@ -1,95 +0,0 @@ |
|||
# 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_qemu import wait_for_console_pattern |
|||
from boot_linux_console import LinuxKernelTest |
|||
|
|||
|
|||
class BootXen(LinuxKernelTest): |
|||
""" |
|||
Boots a Xen hypervisor with a Linux DomU kernel. |
|||
|
|||
:avocado: tags=arch:aarch64 |
|||
:avocado: tags=accel:tcg |
|||
:avocado: tags=cpu:cortex-a57 |
|||
:avocado: tags=machine:virt |
|||
""" |
|||
|
|||
timeout = 90 |
|||
XEN_COMMON_COMMAND_LINE = 'dom0_mem=128M loglvl=all guest_loglvl=all' |
|||
|
|||
def setUp(self): |
|||
super(BootXen, self).setUp() |
|||
|
|||
# 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' |
|||
self.kernel_path = self.fetch_asset(kernel_url, |
|||
asset_hash=kernel_sha1) |
|||
|
|||
def launch_xen(self, xen_path): |
|||
""" |
|||
Launch Xen with a dom0 guest kernel |
|||
""" |
|||
self.log.info("launch with xen_path: %s", xen_path) |
|||
|
|||
self.vm.set_console() |
|||
|
|||
self.vm.add_args('-machine', 'virtualization=on', |
|||
'-m', '768', |
|||
'-kernel', xen_path, |
|||
'-append', self.XEN_COMMON_COMMAND_LINE, |
|||
'-device', |
|||
'guest-loader,addr=0x47000000,kernel=%s,bootargs=console=hvc0' |
|||
% (self.kernel_path)) |
|||
|
|||
self.vm.launch() |
|||
|
|||
console_pattern = 'VFS: Cannot open root device' |
|||
wait_for_console_pattern(self, console_pattern, "Panic on CPU 0:") |
|||
|
|||
def test_arm64_xen_411_and_dom0(self): |
|||
# archive of file from https://deb.debian.org/debian/pool/main/x/xen/ |
|||
xen_url = ('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/' |
|||
'download?path=%2F&files=' |
|||
'xen-hypervisor-4.11-arm64_4.11.4%2B37-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) |
|||
|
|||
def test_arm64_xen_414_and_dom0(self): |
|||
# archive of file from https://deb.debian.org/debian/pool/main/x/xen/ |
|||
xen_url = ('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/' |
|||
'download?path=%2F&files=' |
|||
'xen-hypervisor-4.14-arm64_4.14.0%2B80-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) |
|||
|
|||
def test_arm64_xen_415_and_dom0(self): |
|||
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) |
|||
@ -1,69 +0,0 @@ |
|||
# Functional test that hotplugs a virtio blk disk and checks it on a Linux |
|||
# guest |
|||
# |
|||
# Copyright (c) 2021 Red Hat, Inc. |
|||
# Copyright (c) Yandex |
|||
# |
|||
# 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 time |
|||
|
|||
from avocado_qemu.linuxtest import LinuxTest |
|||
|
|||
|
|||
class HotPlug(LinuxTest): |
|||
def blockdev_add(self) -> None: |
|||
self.vm.cmd('blockdev-add', **{ |
|||
'driver': 'null-co', |
|||
'size': 1073741824, |
|||
'node-name': 'disk' |
|||
}) |
|||
|
|||
def assert_vda(self) -> None: |
|||
self.ssh_command('test -e /sys/block/vda') |
|||
|
|||
def assert_no_vda(self) -> None: |
|||
with self.assertRaises(AssertionError): |
|||
self.assert_vda() |
|||
|
|||
def plug(self) -> None: |
|||
args = { |
|||
'driver': 'virtio-blk-pci', |
|||
'drive': 'disk', |
|||
'id': 'virtio-disk0', |
|||
'bus': 'pci.1', |
|||
'addr': '1', |
|||
} |
|||
|
|||
self.assert_no_vda() |
|||
self.vm.cmd('device_add', args) |
|||
try: |
|||
self.assert_vda() |
|||
except AssertionError: |
|||
time.sleep(1) |
|||
self.assert_vda() |
|||
|
|||
def unplug(self) -> None: |
|||
self.vm.cmd('device_del', id='virtio-disk0') |
|||
|
|||
self.vm.event_wait('DEVICE_DELETED', 1.0, |
|||
match={'data': {'device': 'virtio-disk0'}}) |
|||
|
|||
self.assert_no_vda() |
|||
|
|||
def test(self) -> None: |
|||
""" |
|||
:avocado: tags=arch:x86_64 |
|||
:avocado: tags=machine:q35 |
|||
:avocado: tags=accel:kvm |
|||
""" |
|||
self.require_accelerator('kvm') |
|||
self.vm.add_args('-accel', 'kvm') |
|||
self.vm.add_args('-device', 'pcie-pci-bridge,id=pci.1,bus=pcie.0') |
|||
|
|||
self.launch_and_wait() |
|||
self.blockdev_add() |
|||
|
|||
self.plug() |
|||
self.unplug() |
|||
@ -0,0 +1,90 @@ |
|||
#!/usr/bin/env python3 |
|||
# |
|||
# 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. |
|||
|
|||
from qemu_test import Asset, LinuxKernelTest, wait_for_console_pattern |
|||
|
|||
|
|||
class BootXen(LinuxKernelTest): |
|||
""" |
|||
Boots a Xen hypervisor with a Linux DomU kernel. |
|||
""" |
|||
|
|||
timeout = 90 |
|||
XEN_COMMON_COMMAND_LINE = 'dom0_mem=128M loglvl=all guest_loglvl=all' |
|||
|
|||
ASSET_KERNEL = Asset( |
|||
('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/' |
|||
'download?path=%2F&files=linux-5.9.9-arm64-ajb'), |
|||
'00366fa51ea957c19462d2e2aefd480bef80ce727120e714ae48e0c88f261edb') |
|||
|
|||
def launch_xen(self, xen_path): |
|||
""" |
|||
Launch Xen with a dom0 guest kernel |
|||
""" |
|||
self.set_machine('virt') |
|||
self.cpu = "cortex-a57" |
|||
self.kernel_path = self.ASSET_KERNEL.fetch() |
|||
self.log.info("launch with xen_path: %s", xen_path) |
|||
|
|||
self.vm.set_console() |
|||
|
|||
self.vm.add_args('-machine', 'virtualization=on', |
|||
'-m', '768', |
|||
'-kernel', xen_path, |
|||
'-append', self.XEN_COMMON_COMMAND_LINE, |
|||
'-device', |
|||
'guest-loader,addr=0x47000000,kernel=%s,bootargs=console=hvc0' |
|||
% (self.kernel_path)) |
|||
|
|||
self.vm.launch() |
|||
|
|||
console_pattern = 'VFS: Cannot open root device' |
|||
wait_for_console_pattern(self, console_pattern, "Panic on CPU 0:") |
|||
|
|||
ASSET_XEN_4_11 = Asset( |
|||
('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/download?path=%2F&' |
|||
'files=xen-hypervisor-4.11-arm64_4.11.4%2B37-g3263f257ca-1_arm64.deb'), |
|||
'b745c2631342f9fcc0147ddc364edb62c20ecfebd430e5a3546e7d7c6891c0bc') |
|||
|
|||
def test_arm64_xen_411_and_dom0(self): |
|||
# archive of file from https://deb.debian.org/debian/pool/main/x/xen/ |
|||
xen_path = self.archive_extract(self.ASSET_XEN_4_11, format='deb', |
|||
member="boot/xen-4.11-arm64") |
|||
self.launch_xen(xen_path) |
|||
|
|||
ASSET_XEN_4_14 = Asset( |
|||
('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/download?path=%2F&' |
|||
'files=xen-hypervisor-4.14-arm64_4.14.0%2B80-gd101b417b7-1_arm64.deb'), |
|||
'e930a3293248edabd367d5b4b3b6448b9c99c057096ea8b47228a7870661d5cb') |
|||
|
|||
def test_arm64_xen_414_and_dom0(self): |
|||
# archive of file from https://deb.debian.org/debian/pool/main/x/xen/ |
|||
xen_path = self.archive_extract(self.ASSET_XEN_4_14, format='deb', |
|||
member="boot/xen-4.14-arm64") |
|||
self.launch_xen(xen_path) |
|||
|
|||
ASSET_XEN_4_15 = Asset( |
|||
('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/download?path=%2F&' |
|||
'files=xen-upstream-4.15-unstable.deb'), |
|||
'2a9a8af8acf0231844657cc28baab95bd918b0ee2d493ee4ee6f8846e1358bc9') |
|||
|
|||
def test_arm64_xen_415_and_dom0(self): |
|||
xen_path = self.archive_extract(self.ASSET_XEN_4_15, format='deb', |
|||
member="boot/xen-4.15-unstable") |
|||
self.launch_xen(xen_path) |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
LinuxKernelTest.main() |
|||
@ -0,0 +1,38 @@ |
|||
#!/usr/bin/env python3 |
|||
# |
|||
# Functional test that boots a sam460ex machine with a PPC 460EX CPU |
|||
# |
|||
# SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
from qemu_test import LinuxKernelTest, Asset |
|||
from qemu_test import exec_command_and_wait_for_pattern |
|||
|
|||
|
|||
class sam460exTest(LinuxKernelTest): |
|||
|
|||
ASSET_BR2_SAM460EX_LINUX = Asset( |
|||
'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc_sam460ex-2023.11-8-gdcd9f0f6eb-20240105/vmlinux', |
|||
'6f46346f3e20e8b5fc050ff363f350f8b9d76a051b9e0bd7ea470cc680c14df2') |
|||
|
|||
def test_ppc_sam460ex_buildroot(self): |
|||
self.set_machine('sam460ex') |
|||
self.require_netdev('user') |
|||
|
|||
linux_path = self.ASSET_BR2_SAM460EX_LINUX.fetch() |
|||
|
|||
self.vm.set_console() |
|||
self.vm.add_args('-kernel', linux_path, |
|||
'-device', 'virtio-net-pci,netdev=net0', |
|||
'-netdev', 'user,id=net0') |
|||
self.vm.launch() |
|||
|
|||
self.wait_for_console_pattern('Linux version') |
|||
self.wait_for_console_pattern('Hardware name: amcc,canyonlands 460EX') |
|||
self.wait_for_console_pattern('/init as init process') |
|||
self.wait_for_console_pattern('lease of 10.0.2.15 obtained') |
|||
self.wait_for_console_pattern('buildroot login:') |
|||
exec_command_and_wait_for_pattern(self, 'root', '#') |
|||
exec_command_and_wait_for_pattern(self, 'poweroff', 'System Halted') |
|||
|
|||
if __name__ == '__main__': |
|||
LinuxKernelTest.main() |
|||
@ -0,0 +1,85 @@ |
|||
#!/usr/bin/env python3 |
|||
# |
|||
# Functional test that hotplugs a virtio blk disk and checks it on a Linux |
|||
# guest |
|||
# |
|||
# Copyright (c) 2021 Red Hat, Inc. |
|||
# Copyright (c) Yandex |
|||
# |
|||
# This work is licensed under the terms of the GNU GPL, version 2 or |
|||
# later. See the COPYING file in the top-level directory. |
|||
|
|||
from qemu_test import LinuxKernelTest, Asset, exec_command_and_wait_for_pattern |
|||
|
|||
|
|||
class HotPlugBlk(LinuxKernelTest): |
|||
|
|||
ASSET_KERNEL = Asset( |
|||
('https://archives.fedoraproject.org/pub/archive/fedora/linux/releases' |
|||
'/31/Server/x86_64/os/images/pxeboot/vmlinuz'), |
|||
'd4738d03dbbe083ca610d0821d0a8f1488bebbdccef54ce33e3adb35fda00129') |
|||
|
|||
ASSET_INITRD = Asset( |
|||
('https://archives.fedoraproject.org/pub/archive/fedora/linux/releases' |
|||
'/31/Server/x86_64/os/images/pxeboot/initrd.img'), |
|||
'277cd6c7adf77c7e63d73bbb2cded8ef9e2d3a2f100000e92ff1f8396513cd8b') |
|||
|
|||
def blockdev_add(self) -> None: |
|||
self.vm.cmd('blockdev-add', **{ |
|||
'driver': 'null-co', |
|||
'size': 1073741824, |
|||
'node-name': 'disk' |
|||
}) |
|||
|
|||
def assert_vda(self) -> None: |
|||
exec_command_and_wait_for_pattern(self, 'while ! test -e /sys/block/vda ;' |
|||
' do sleep 0.2 ; done', '# ') |
|||
|
|||
def assert_no_vda(self) -> None: |
|||
exec_command_and_wait_for_pattern(self, 'while test -e /sys/block/vda ;' |
|||
' do sleep 0.2 ; done', '# ') |
|||
|
|||
def plug(self) -> None: |
|||
args = { |
|||
'driver': 'virtio-blk-pci', |
|||
'drive': 'disk', |
|||
'id': 'virtio-disk0', |
|||
'bus': 'pci.1', |
|||
'addr': '1', |
|||
} |
|||
|
|||
self.assert_no_vda() |
|||
self.vm.cmd('device_add', args) |
|||
self.wait_for_console_pattern('virtio_blk virtio0: [vda]') |
|||
self.assert_vda() |
|||
|
|||
def unplug(self) -> None: |
|||
self.vm.cmd('device_del', id='virtio-disk0') |
|||
|
|||
self.vm.event_wait('DEVICE_DELETED', 1.0, |
|||
match={'data': {'device': 'virtio-disk0'}}) |
|||
|
|||
self.assert_no_vda() |
|||
|
|||
def test(self) -> None: |
|||
self.require_accelerator('kvm') |
|||
self.set_machine('q35') |
|||
|
|||
self.vm.add_args('-accel', 'kvm') |
|||
self.vm.add_args('-device', 'pcie-pci-bridge,id=pci.1,bus=pcie.0') |
|||
self.vm.add_args('-m', '1G') |
|||
self.vm.add_args('-append', 'console=ttyS0 rd.rescue') |
|||
|
|||
self.launch_kernel(self.ASSET_KERNEL.fetch(), |
|||
self.ASSET_INITRD.fetch(), |
|||
wait_for='Entering emergency mode.') |
|||
self.wait_for_console_pattern('# ') |
|||
|
|||
self.blockdev_add() |
|||
|
|||
self.plug() |
|||
self.unplug() |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
LinuxKernelTest.main() |
|||
Loading…
Reference in new issue