Skip to contentSkip to conversation

testing/next: libvirt-ci, tests/vm and vbsa functional test

PATCH Superseded Alex Bennée 2 participants 16 messages Feb 13 – Feb 19 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover testing/next: libvirt-ci, tests/vm and vbsa functional test

While I was looking at Jon's python patches I noticed some failures with getting OpenBSD up and running. In pulling that thread I found a few other bits to fix and up revved the image and converted it to use lci-tool data like FreeBSD does.

I've also added the VBSA conformance test for Arm virt machines to the functional tests. This just adds the UEFI based tests as the full suite needs kernel modules and a userspace app which I think I have to build.

Alex.

Alex Bennée (6):
tests: bump libvirt-ci to latest state tests/vm: bump OpenBSD to the current 7.8 release tests/vm: remove unused import
tests/vm: fix interactive boot
tests/vm: build openbsd from lcitool data (!567) tests/functional: add Arm VBSA uefi conformance test

 tests/docker/dockerfiles/alpine.docker        |   4 +-
 tests/docker/dockerfiles/centos9.docker       | 240 ++++++++--------
 .../dockerfiles/fedora-rust-nightly.docker    | 262 +++++++++---------
 .../dockerfiles/fedora-win64-cross.docker     | 162 +++++------
 tests/docker/dockerfiles/fedora.docker        | 262 +++++++++---------
 tests/functional/aarch64/meson.build          |   1 +
 tests/functional/aarch64/test_virt_vbsa.py    |  99 +++++++
 tests/lcitool/libvirt-ci                      |   2 +-
 tests/lcitool/refresh                         |  13 +-
 tests/vm/Makefile.include                     |   2 +-
 tests/vm/generated/openbsd.json               |  27 ++
 tests/vm/openbsd                              |  44 +--
 12 files changed, 605 insertions(+), 513 deletions(-)
 create mode 100755 tests/functional/aarch64/test_virt_vbsa.py
 create mode 100644 tests/vm/generated/openbsd.json
Signature · 1 line
2.47.3
#1 lore raw

PATCH 1/6 tests: bump libvirt-ci to latest state

This entails updating alpine and fedora images to more recent versions as well as the missing macos-14.vars update missed from last time.

---
 tests/docker/dockerfiles/alpine.docker        |   4 +-
 tests/docker/dockerfiles/centos9.docker       | 240 ++++++++--------
 .../dockerfiles/fedora-rust-nightly.docker    | 262 +++++++++---------
 .../dockerfiles/fedora-win64-cross.docker     | 162 +++++------
 tests/docker/dockerfiles/fedora.docker        | 262 +++++++++---------
 tests/lcitool/libvirt-ci                      |   2 +-
 tests/lcitool/refresh                         |   8 +-
 7 files changed, 470 insertions(+), 470 deletions(-)
tests/docker/dockerfiles/alpine.docker +2 -2
index 03dd6851f60..76d8dd8cfc7 100644
@@ -1,10 +1,10 @@
 # THIS FILE WAS AUTO-GENERATED
 #
-#  $ lcitool dockerfile --layers all alpine-321 qemu
+#  $ lcitool dockerfile --layers all alpine-323 qemu
 #
 # https://gitlab.com/libvirt/libvirt-ci
 
-FROM docker.io/library/alpine:3.21
+FROM docker.io/library/alpine:3.23
 
 RUN apk update && \
     apk upgrade && \
tests/docker/dockerfiles/centos9.docker +120 -120

246 lines not on this page · raw message

tests/docker/dockerfiles/fedora-rust-nightly.docker +131 -131

277 lines not on this page · raw message

tests/docker/dockerfiles/fedora-win64-cross.docker +81 -81

183 lines not on this page · raw message

tests/docker/dockerfiles/fedora.docker +131 -131

277 lines not on this page · raw message

tests/lcitool/libvirt-ci +1 -1
index caed407a0f1..750455ce119 160000
@@ -1 +1 @@
-Subproject commit caed407a0f1dfe3a3293a41c378c382deefbac36
+Subproject commit 750455ce1199db7e304a6b4feae5f290283dd52a
tests/lcitool/refresh +4 -4
index 01a71929542..8f0aa3fa343 100755
@@ -215,12 +215,12 @@ try:
     #
     # Standard native builds
     #
-    generate_dockerfile("alpine", "alpine-321",
+    generate_dockerfile("alpine", "alpine-323",
                         trailer="".join(alpine_extras))
     generate_dockerfile("centos9", "centos-stream-9")
     generate_dockerfile("debian", "debian-13",
                         trailer="".join(debian13_extras))
-    generate_dockerfile("fedora", "fedora-41")
+    generate_dockerfile("fedora", "fedora-43")
     generate_dockerfile("opensuse-leap", "opensuse-leap-15")
     generate_dockerfile("ubuntu2204", "ubuntu-2204",
                         trailer="".join(ubuntu2204_rust_extras),
@@ -230,7 +230,7 @@ try:
     #
     # Non-fatal Rust-enabled build
     #
-    generate_dockerfile("fedora-rust-nightly", "fedora-41",
+    generate_dockerfile("fedora-rust-nightly", "fedora-43",
                         trailer="".join(fedora_rustup_nightly_extras))
 
     #
@@ -287,7 +287,7 @@ try:
                         trailer=cross_build("s390x-linux-gnu-",
                                             "s390x-softmmu,s390x-linux-user"))
 
-    generate_dockerfile("fedora-win64-cross", "fedora-41",
+    generate_dockerfile("fedora-win64-cross", "fedora-43",
                         project='qemu,qemu-win-installer',
                         cross="mingw64",
                         trailer=cross_build("x86_64-w64-mingw32-",
Signature · 1 line
2.47.3
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] tests: bump libvirt-ci to latest state

Quoted 4 lines · Alex Bennée

This entails updating alpine and fedora images to more recent versions as well as the missing macos-14.vars update missed from last time.

Quoted 10 lines
---
  tests/docker/dockerfiles/alpine.docker        |   4 +-
  tests/docker/dockerfiles/centos9.docker       | 240 ++++++++--------
  .../dockerfiles/fedora-rust-nightly.docker    | 262 +++++++++---------
  .../dockerfiles/fedora-win64-cross.docker     | 162 +++++------
  tests/docker/dockerfiles/fedora.docker        | 262 +++++++++---------
  tests/lcitool/libvirt-ci                      |   2 +-
  tests/lcitool/refresh                         |   8 +-
  7 files changed, 470 insertions(+), 470 deletions(-)
#3 lore raw

PATCH 2/6 tests/vm: bump OpenBSD to the current 7.8 release

In reply to Alex Bennée
---
 tests/vm/openbsd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/vm/openbsd +2 -2
index 2ea86a01bad..88b31dd9b59 100755
@@ -22,8 +22,8 @@ class OpenBSDVM(basevm.BaseVM):
     name = "openbsd"
     arch = "x86_64"
 
-    link = "https://cdn.openbsd.org/pub/OpenBSD/7.7/amd64/install77.iso"
-    csum = "da0106e39463f015524dca806f407c37a9bdd17e6dfffe533b06a2dd2edd8a27"
+    link = "https://cdn.openbsd.org/pub/OpenBSD/7.8/amd64/install78.iso"
+    csum = "a228d0a1ef558b4d9ec84c698f0d3ffd13cd38c64149487cba0f1ad873be07b2"
     size = "20G"
     pkgs = [
         # tools
Signature · 1 line
2.47.3
#5 lore raw

PATCH 3/6 tests/vm: remove unused import

In reply to Alex Bennée
---
 tests/vm/openbsd | 1 -
 1 file changed, 1 deletion(-)
tests/vm/openbsd +0 -1
index 88b31dd9b59..52565208965 100755
@@ -14,7 +14,6 @@
 
 import os
 import sys
-import socket
 import subprocess
 import basevm
 
Signature · 1 line
2.47.3
#7 lore raw

PATCH 4/6 tests/vm: fix interactive boot

In reply to Alex Bennée

For reasons still not clear to me passing the single dashed -interactive would confuse the argument parsing enough we tried to pass "nterative" as a string to the launch command causing failure and head scratching.

---
 tests/vm/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/vm/Makefile.include +1 -1
index 14188bba1c6..bf4b83d2a45 100644
@@ -142,6 +142,6 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(VM_VENV)
 		$(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \
 		$(if $(LOG_CONSOLE),--log-console) \
 		--image "$<" \
-		$(if $(ROOT_USER),--interactive-root,-interactive) \
+		$(if $(ROOT_USER),--interactive-root,--interactive) \
 		false, \
 		"  VM-BOOT-SSH $*") || true
Signature · 1 line
2.47.3
Reviewed-by on v1 4/6
#8 lore raw

Re: [PATCH 4/6] tests/vm: fix interactive boot

Quoted 10 lines · Alex Bennée

For reasons still not clear to me passing the single dashed -interactive would confuse the argument parsing enough we tried to pass "nterative" as a string to the launch command causing failure and head scratching.

---
  tests/vm/Makefile.include | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
#9 lore raw

PATCH 5/6 tests/vm: build openbsd from lcitool data (!567)

In reply to Alex Bennée

For now only use the minimal decadency set until all the OpenBSD mappings can be divined.

Currently depends on: https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/567

---
 tests/lcitool/libvirt-ci        |  2 +-
 tests/lcitool/refresh           |  5 +++--
 tests/vm/generated/openbsd.json | 27 +++++++++++++++++++++++
 tests/vm/openbsd                | 39 ++-------------------------------
 4 files changed, 33 insertions(+), 40 deletions(-)
 create mode 100644 tests/vm/generated/openbsd.json
tests/lcitool/libvirt-ci +1 -1
index 750455ce119..dedaa8ebb5d 160000
@@ -1 +1 @@
-Subproject commit 750455ce1199db7e304a6b4feae5f290283dd52a
+Subproject commit dedaa8ebb5d743ba8906a87e623d90f33100aecd
tests/lcitool/refresh +3 -2
index 8f0aa3fa343..95344277c9a 100755
@@ -87,9 +87,9 @@ def generate_cirrus(target, trailer=None):
     generate(filename, cmd, trailer)
 
 
-def generate_pkglist(vm, target):
+def generate_pkglist(vm, target, project="qemu"):
     filename = Path(src_dir, "tests", "vm", "generated", vm + ".json")
-    cmd = lcitool_cmd + ["variables", "--format", "json", target, "qemu"]
+    cmd = lcitool_cmd + ["variables", "--format", "json", target, project]
     generate(filename, cmd, None)
 
 
@@ -312,6 +312,7 @@ try:
     # VM packages lists
     #
     generate_pkglist("freebsd", "freebsd-14")
+    generate_pkglist("openbsd", "openbsd-78", project="qemu-minimal")
 
     #
     # Ansible package lists
tests/vm/generated/openbsd.json new file +27 -0
new file mode 100644
index 00000000000..0886afd0d3d
@@ -0,0 +1,27 @@
+{
+  "ccache": "/usr/local/bin/ccache",
+  "cpan_pkgs": [],
+  "cross_pkgs": [],
+  "make": "/usr/local/bin/gmake",
+  "ninja": "/usr/local/bin/ninja",
+  "packaging_command": "pkg_add",
+  "pip3": "/usr/local/bin/pip3",
+  "pkgs": [
+    "bash",
+    "bison",
+    "bzip2",
+    "ccache",
+    "dtc",
+    "git",
+    "glib2",
+    "gmake",
+    "gsed",
+    "libffi",
+    "meson",
+    "ninja",
+    "pkgconf",
+    "python3"
+  ],
+  "pypi_pkgs": [],
+  "python": "/usr/local/bin/python3"
+}
tests/vm/openbsd +2 -37
index 52565208965..4f8eeb28e24 100755
@@ -24,42 +24,6 @@ class OpenBSDVM(basevm.BaseVM):
     link = "https://cdn.openbsd.org/pub/OpenBSD/7.8/amd64/install78.iso"
     csum = "a228d0a1ef558b4d9ec84c698f0d3ffd13cd38c64149487cba0f1ad873be07b2"
     size = "20G"
-    pkgs = [
-        # tools
-        "dtc",
-        "git",
-        "pkgconf",
-        "bzip2", "xz",
-        "ninja",
-
-        # gnu tools
-        "bash",
-        "gmake",
-        "gsed",
-        "gettext-tools",
-
-        # libs: usb
-        "libusb1--",
-
-        # libs: crypto
-        "gnutls",
-
-        # libs: images
-        "jpeg",
-        "png",
-
-        # libs: ui
-        "capstone",
-        "sdl2",
-        "gtk+3",
-        "libxkbcommon",
-
-        # libs: migration
-        "zstd",
-
-        # libs: networking
-        "libslirp",
-    ]
 
     BUILD_SCRIPT = """
         set -e;
@@ -195,8 +159,9 @@ class OpenBSDVM(basevm.BaseVM):
         self.console_wait("login:")
         self.wait_ssh()
 
+        pkgs = self.get_qemu_packages_from_lcitool_json()
         self.print_step("Installing packages")
-        self.ssh_root_check("pkg_add %s\n" % " ".join(self.pkgs))
+        self.ssh_root_check("pkg_add %s\n" % " ".join(pkgs))
 
         # shutdown
         self.ssh_root(self.poweroff)
Signature · 1 line
2.47.3
Reviewed-by on v1 5/6
#10 lore raw

Re: [PATCH 5/6] tests/vm: build openbsd from lcitool data (!567)

Quoted 5 lines · Alex Bennée

For now only use the minimal decadency set until all the OpenBSD mappings can be divined.

Currently depends on: https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/567

Quoted 9 lines
---
  tests/lcitool/libvirt-ci        |  2 +-
  tests/lcitool/refresh           |  5 +++--
  tests/vm/generated/openbsd.json | 27 +++++++++++++++++++++++
  tests/vm/openbsd                | 39 ++-------------------------------
  4 files changed, 33 insertions(+), 40 deletions(-)

create mode 100644 tests/vm/generated/openbsd.json

#11 lore raw

PATCH 6/6 tests/functional: add Arm VBSA uefi conformance test

In reply to Alex Bennée

The VBSA test is a subset of the wider Arm architecture compliance suites (ACS) which validate machines meet particular minimum set of requirements. The VBSA is for virtual machines so it makes sense we should check the -M virt machine is compliant.

Fortunately there are prebuilt binaries published via github so all we need to do is build an EFI partition and place things in the right place.

There are some additional Linux based tests which are left for later.

---
 tests/functional/aarch64/meson.build       |  1 +
 tests/functional/aarch64/test_virt_vbsa.py | 99 ++++++++++++++++++++++
 2 files changed, 100 insertions(+)
 create mode 100755 tests/functional/aarch64/test_virt_vbsa.py
tests/functional/aarch64/meson.build +1 -0
index 49eca120589..7ea8c22b048 100644
@@ -46,6 +46,7 @@ tests_aarch64_system_thorough = [
   'tuxrun',
   'virt',
   'virt_gpu',
+  'virt_vbsa',
   'xen',
   'xlnx_versal',
 ]
tests/functional/aarch64/test_virt_vbsa.py new file +99 -0

99 lines not on this page · raw message

Signature · 1 line
2.47.3
#12 lore raw

Re: [PATCH 6/6] tests/functional: add Arm VBSA uefi conformance test

Quoted 83 lines · Alex Bennée

The VBSA test is a subset of the wider Arm architecture compliance suites (ACS) which validate machines meet particular minimum set of requirements. The VBSA is for virtual machines so it makes sense we should check the -M virt machine is compliant.

Fortunately there are prebuilt binaries published via github so all we need to do is build an EFI partition and place things in the right place.

There are some additional Linux based tests which are left for later.

---
 tests/functional/aarch64/meson.build       |  1 +
 tests/functional/aarch64/test_virt_vbsa.py | 99 ++++++++++++++++++++++
 2 files changed, 100 insertions(+)
 create mode 100755 tests/functional/aarch64/test_virt_vbsa.py
tests/functional/aarch64/meson.build +1 -0
index 49eca120589..7ea8c22b048 100644
@@ -46,6 +46,7 @@ tests_aarch64_system_thorough = [
   'tuxrun',
   'virt',
   'virt_gpu',
+  'virt_vbsa',
   'xen',
   'xlnx_versal',
 ]
tests/functional/aarch64/test_virt_vbsa.py new file +47 -0
new file mode 100755
index 00000000000..53cabf9d6c5
@@ -0,0 +1,99 @@
+#!/usr/bin/env python3
+#
+# Functional test that runs the Arm VBSA conformance tests.
+#
+# Copyright (c) 2026 Linaro Ltd.
+#
+# Author:
+#  Alex Bennée <[email protected]>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import shutil
+from subprocess import check_call, DEVNULL
+
+from qemu_test import QemuSystemTest, Asset
+from qemu_test import wait_for_console_pattern, get_qemu_img, skipIfMissingCommands
+from qemu_test import exec_command_and_wait_for_pattern as ec_and_wait
+
+
+@skipIfMissingCommands("mformat", "mcopy", "mmd")
+class Aarch64VirtMachine(QemuSystemTest):
+    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
+    timeout = 360
+
+    def wait_for_console_pattern(self, success_message, vm=None):
+        wait_for_console_pattern(self, success_message,
+                                 failure_message='Kernel panic - not syncing',
+                                 vm=vm)
+
+    ASSET_VBSA_EFI = Asset('https://github.com/ARM-software/sysarch-acs/raw/refs/heads/main'
+                           '/prebuilt_images/VBSA/v25.12_VBSA_0.7.0/Vbsa.efi',
+                           '80f37d2fb86d152d95dec4d05ff099c9e47ee8a89314268e08056b0e1359e1fa')
+
+    ASSET_BSA_SHELL = Asset('https://github.com/ARM-software/bsa-acs/raw/refs/heads/main/'
+                            'prebuilt_images/BSA_DT/v20.05_05_ALPHA/Shell.efi',
+                            '763e7b293fa9d1582153ea8fd0cf60e2a7a87d092d35d342cf9b3b697f47b588')
+
+    def test_aarch64_vbsa_uefi_tests(self):
+        """
+        Launch the UEFI based VBSA test from an EFI file-system
+        """
+
+        self.vm.set_console()
+
+        # virt machine wi
+        self.set_machine('virt')
+        self.vm.add_args('-M',
Quoted 1 line

'virt,gic-version=max,virtualization=on')

We can drop the virtualization=on here so we run under KVM (or HVF?) as well.

Quoted 52 lines
tests/functional/aarch64/test_virt_vbsa.py new file +52 -0
+        self.vm.add_args('-cpu', 'max','-m', '1024')
+
+        # We will use the QEMU firmware blobs to boot
+        code_path = self.build_file('pc-bios', 'edk2-aarch64-code.fd')
+        vars_source = self.build_file('pc-bios', 'edk2-arm-vars.fd')
+        vars_path = self.scratch_file('vars.fd')
+        shutil.copy(vars_source, vars_path)
+
+        self.vm.add_args('-drive', f'if=pflash,format=raw,readonly=on,file={code_path}')
+        self.vm.add_args('-drive', f'if=pflash,format=raw,file={vars_path}')
+
+        # Build an EFI FAT32 file-system for the UEFI tests
+        vbsa_efi = self.ASSET_VBSA_EFI.fetch()
+        bsa_shell = self.ASSET_BSA_SHELL.fetch()
+
+        img_path = self.scratch_file('vbsa.img')
+        qemu_img = get_qemu_img(self)
+        check_call([qemu_img, 'create', '-f', 'raw', img_path, '64M'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mformat', '-i', img_path, '-v', 'VBSA', '::'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mmd', '-i', img_path, '::/EFI'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mmd', '-i', img_path, '::/EFI/BOOT'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mcopy', '-i', img_path, bsa_shell, '::/EFI/BOOT/BOOTAA64.EFI'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mcopy', '-i', img_path, vbsa_efi, '::/Vbsa.efi'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        self.vm.add_args('-drive', f'file={img_path},format=raw,if=none,id=drive0')
+        self.vm.add_args('-device', 'virtio-blk-pci,drive=drive0')
+
+        self.vm.launch()
+
+        # wait for EFI prompt
+        self.wait_for_console_pattern('Shell>')
+
+        # Start the VBSA tests
+        ec_and_wait(self, "FS0:Vbsa.efi", 'VBSA Architecture Compliance Suite')
+
+        # could we parse the summary somehow?
+
+        self.wait_for_console_pattern('VBSA tests complete. Reset the system.')
+
+if __name__ == '__main__':
+    QemuSystemTest.main()
Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#13 lore raw

Re: [PATCH 6/6] tests/functional: add Arm VBSA uefi conformance test

In reply to Alex Bennée
Quoted 55 lines · Alex Bennée

The VBSA test is a subset of the wider Arm architecture compliance suites (ACS) which validate machines meet particular minimum set of requirements. The VBSA is for virtual machines so it makes sense we should check the -M virt machine is compliant.

Fortunately there are prebuilt binaries published via github so all we need to do is build an EFI partition and place things in the right place.

There are some additional Linux based tests which are left for later.

---
  tests/functional/aarch64/meson.build       |  1 +
  tests/functional/aarch64/test_virt_vbsa.py | 99 ++++++++++++++++++++++
  2 files changed, 100 insertions(+)

create mode 100755 tests/functional/aarch64/test_virt_vbsa.py

tests/functional/aarch64/meson.build +1 -0
index 49eca120589..7ea8c22b048 100644
@@ -46,6 +46,7 @@ tests_aarch64_system_thorough = [
    'tuxrun',
    'virt',
    'virt_gpu',
+  'virt_vbsa',
    'xen',
    'xlnx_versal',
  ]
tests/functional/aarch64/test_virt_vbsa.py new file +19 -0
new file mode 100755
index 00000000000..53cabf9d6c5
@@ -0,0 +1,99 @@
+#!/usr/bin/env python3
+#
+# Functional test that runs the Arm VBSA conformance tests.
+#
+# Copyright (c) 2026 Linaro Ltd.
+#
+# Author:
+#  Alex Bennée <[email protected]>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import shutil
+from subprocess import check_call, DEVNULL
+
+from qemu_test import QemuSystemTest, Asset
+from qemu_test import wait_for_console_pattern, get_qemu_img, skipIfMissingCommands
+from qemu_test import exec_command_and_wait_for_pattern as ec_and_wait
+
+

tests/functional/aarch64/test_virt_vbsa.py line 29

Quoted 10 lines
tests/functional/aarch64/test_virt_vbsa.py new file +10 -0
+@skipIfMissingCommands("mformat", "mcopy", "mmd")
+class Aarch64VirtMachine(QemuSystemTest):
+    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
+    timeout = 360
+
+    def wait_for_console_pattern(self, success_message, vm=None):
+        wait_for_console_pattern(self, success_message,
+                                 failure_message='Kernel panic - not syncing',
+                                 vm=vm)
+

May be worth adding a comment with README url:
https://github.com/ARM-software/sysarch-acs/blob/main/docs/vbsa/README.md

Quoted 58 lines
tests/functional/aarch64/test_virt_vbsa.py new file +58 -0
+    ASSET_VBSA_EFI = Asset('https://github.com/ARM-software/sysarch-acs/raw/refs/heads/main'
+                           '/prebuilt_images/VBSA/v25.12_VBSA_0.7.0/Vbsa.efi',
+                           '80f37d2fb86d152d95dec4d05ff099c9e47ee8a89314268e08056b0e1359e1fa')
+
+    ASSET_BSA_SHELL = Asset('https://github.com/ARM-software/bsa-acs/raw/refs/heads/main/'
+                            'prebuilt_images/BSA_DT/v20.05_05_ALPHA/Shell.efi',
+                            '763e7b293fa9d1582153ea8fd0cf60e2a7a87d092d35d342cf9b3b697f47b588')
+
+    def test_aarch64_vbsa_uefi_tests(self):
+        """
+        Launch the UEFI based VBSA test from an EFI file-system
+        """
+
+        self.vm.set_console()
+
+        # virt machine wi
+        self.set_machine('virt')
+        self.vm.add_args('-M', 'virt,gic-version=max,virtualization=on')
+        self.vm.add_args('-cpu', 'max','-m', '1024')
+
+        # We will use the QEMU firmware blobs to boot
+        code_path = self.build_file('pc-bios', 'edk2-aarch64-code.fd')
+        vars_source = self.build_file('pc-bios', 'edk2-arm-vars.fd')
+        vars_path = self.scratch_file('vars.fd')
+        shutil.copy(vars_source, vars_path)
+
+        self.vm.add_args('-drive', f'if=pflash,format=raw,readonly=on,file={code_path}')
+        self.vm.add_args('-drive', f'if=pflash,format=raw,file={vars_path}')
+
+        # Build an EFI FAT32 file-system for the UEFI tests
+        vbsa_efi = self.ASSET_VBSA_EFI.fetch()
+        bsa_shell = self.ASSET_BSA_SHELL.fetch()
+
+        img_path = self.scratch_file('vbsa.img')
+        qemu_img = get_qemu_img(self)
+        check_call([qemu_img, 'create', '-f', 'raw', img_path, '64M'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mformat', '-i', img_path, '-v', 'VBSA', '::'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mmd', '-i', img_path, '::/EFI'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mmd', '-i', img_path, '::/EFI/BOOT'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mcopy', '-i', img_path, bsa_shell, '::/EFI/BOOT/BOOTAA64.EFI'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mcopy', '-i', img_path, vbsa_efi, '::/Vbsa.efi'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        self.vm.add_args('-drive', f'file={img_path},format=raw,if=none,id=drive0')
+        self.vm.add_args('-device', 'virtio-blk-pci,drive=drive0')
+
+        self.vm.launch()
+

tests/functional/aarch64/test_virt_vbsa.py line 97

Quoted 10 lines
tests/functional/aarch64/test_virt_vbsa.py new file +10 -0
+        # wait for EFI prompt
+        self.wait_for_console_pattern('Shell>')
+
+        # Start the VBSA tests
+        ec_and_wait(self, "FS0:Vbsa.efi", 'VBSA Architecture Compliance Suite')
+
+        # could we parse the summary somehow?
+
+        self.wait_for_console_pattern('VBSA tests complete. Reset the system.')
+

What happens in case there is an error, does the test app hangs, or still exit with message under?

If it always exit with this message, whether we have an error or not, then the test is not really checking anything.

Quoted 2 lines
tests/functional/aarch64/test_virt_vbsa.py new file +2 -0
+if __name__ == '__main__':
+    QemuSystemTest.main()
#14 lore raw

Re: [PATCH 6/6] tests/functional: add Arm VBSA uefi conformance test

Quoted 132 lines · Pierrick Bouvier
Quoted 54 lines · Alex Bennée

The VBSA test is a subset of the wider Arm architecture compliance suites (ACS) which validate machines meet particular minimum set of requirements. The VBSA is for virtual machines so it makes sense we should check the -M virt machine is compliant. Fortunately there are prebuilt binaries published via github so all we
need to do is build an EFI partition and place things in the right place.
There are some additional Linux based tests which are left for later.

---
  tests/functional/aarch64/meson.build       |  1 +
  tests/functional/aarch64/test_virt_vbsa.py | 99 ++++++++++++++++++++++
  2 files changed, 100 insertions(+)

create mode 100755 tests/functional/aarch64/test_virt_vbsa.py

tests/functional/aarch64/meson.build +1 -0
index 49eca120589..7ea8c22b048 100644
@@ -46,6 +46,7 @@ tests_aarch64_system_thorough = [
    'tuxrun',
    'virt',
    'virt_gpu',
+  'virt_vbsa',
    'xen',
    'xlnx_versal',
  ]
tests/functional/aarch64/test_virt_vbsa.py new file +19 -0
new file mode 100755
index 00000000000..53cabf9d6c5
@@ -0,0 +1,99 @@
+#!/usr/bin/env python3
+#
+# Functional test that runs the Arm VBSA conformance tests.
+#
+# Copyright (c) 2026 Linaro Ltd.
+#
+# Author:
+#  Alex Bennée <[email protected]>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import shutil
+from subprocess import check_call, DEVNULL
+
+from qemu_test import QemuSystemTest, Asset
+from qemu_test import wait_for_console_pattern, get_qemu_img, skipIfMissingCommands
+from qemu_test import exec_command_and_wait_for_pattern as ec_and_wait
+
+

tests/functional/aarch64/test_virt_vbsa.py line 29

Quoted 10 lines
tests/functional/aarch64/test_virt_vbsa.py new file +10 -0
+@skipIfMissingCommands("mformat", "mcopy", "mmd")
+class Aarch64VirtMachine(QemuSystemTest):
+    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
+    timeout = 360
+
+    def wait_for_console_pattern(self, success_message, vm=None):
+        wait_for_console_pattern(self, success_message,
+                                 failure_message='Kernel panic - not syncing',
+                                 vm=vm)
+

May be worth adding a comment with README url:
https://github.com/ARM-software/sysarch-acs/blob/main/docs/vbsa/README.md

Quoted 63 lines
tests/functional/aarch64/test_virt_vbsa.py new file +63 -0
+    ASSET_VBSA_EFI = Asset('https://github.com/ARM-software/sysarch-acs/raw/refs/heads/main'
+                           '/prebuilt_images/VBSA/v25.12_VBSA_0.7.0/Vbsa.efi',
+                           '80f37d2fb86d152d95dec4d05ff099c9e47ee8a89314268e08056b0e1359e1fa')
+
+    ASSET_BSA_SHELL = Asset('https://github.com/ARM-software/bsa-acs/raw/refs/heads/main/'
+                            'prebuilt_images/BSA_DT/v20.05_05_ALPHA/Shell.efi',
+                            '763e7b293fa9d1582153ea8fd0cf60e2a7a87d092d35d342cf9b3b697f47b588')
+
+    def test_aarch64_vbsa_uefi_tests(self):
+        """
+        Launch the UEFI based VBSA test from an EFI file-system
+        """
+
+        self.vm.set_console()
+
+        # virt machine wi
+        self.set_machine('virt')
+        self.vm.add_args('-M', 'virt,gic-version=max,virtualization=on')
+        self.vm.add_args('-cpu', 'max','-m', '1024')
+
+        # We will use the QEMU firmware blobs to boot
+        code_path = self.build_file('pc-bios', 'edk2-aarch64-code.fd')
+        vars_source = self.build_file('pc-bios', 'edk2-arm-vars.fd')
+        vars_path = self.scratch_file('vars.fd')
+        shutil.copy(vars_source, vars_path)
+
+        self.vm.add_args('-drive', f'if=pflash,format=raw,readonly=on,file={code_path}')
+        self.vm.add_args('-drive', f'if=pflash,format=raw,file={vars_path}')
+
+        # Build an EFI FAT32 file-system for the UEFI tests
+        vbsa_efi = self.ASSET_VBSA_EFI.fetch()
+        bsa_shell = self.ASSET_BSA_SHELL.fetch()
+
+        img_path = self.scratch_file('vbsa.img')
+        qemu_img = get_qemu_img(self)
+        check_call([qemu_img, 'create', '-f', 'raw', img_path, '64M'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mformat', '-i', img_path, '-v', 'VBSA', '::'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mmd', '-i', img_path, '::/EFI'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mmd', '-i', img_path, '::/EFI/BOOT'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mcopy', '-i', img_path, bsa_shell, '::/EFI/BOOT/BOOTAA64.EFI'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mcopy', '-i', img_path, vbsa_efi, '::/Vbsa.efi'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        self.vm.add_args('-drive', f'file={img_path},format=raw,if=none,id=drive0')
+        self.vm.add_args('-device', 'virtio-blk-pci,drive=drive0')
+
+        self.vm.launch()
+
+        # wait for EFI prompt
+        self.wait_for_console_pattern('Shell>')
+
+        # Start the VBSA tests
+        ec_and_wait(self, "FS0:Vbsa.efi", 'VBSA Architecture Compliance Suite')
Quoted 8 lines

tests/functional/aarch64/test_virt_vbsa.py line 97

Quoted 5 lines
tests/functional/aarch64/test_virt_vbsa.py new file +5 -0
+
+        # could we parse the summary somehow?
+
+        self.wait_for_console_pattern('VBSA tests complete. Reset the system.')
+

What happens in case there is an error, does the test app hangs, or still exit with message under?

The failures I had were generally hangs but ideally we would parse the the summary data and generate our response based on that. Unfortunately that is at odds with the current send/wait for pass/fail message infrastructure.

Quoted 6 lines

If it always exit with this message, whether we have an error or not, then the test is not really checking anything.

Quoted 2 lines
tests/functional/aarch64/test_virt_vbsa.py new file +2 -0
+if __name__ == '__main__':
+    QemuSystemTest.main()
Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#15 lore raw

Re: [PATCH 6/6] tests/functional: add Arm VBSA uefi conformance test

Quoted 143 lines · Alex Bennée
Quoted 132 lines · Pierrick Bouvier
Quoted 54 lines · Alex Bennée

The VBSA test is a subset of the wider Arm architecture compliance suites (ACS) which validate machines meet particular minimum set of requirements. The VBSA is for virtual machines so it makes sense we should check the -M virt machine is compliant. Fortunately there are prebuilt binaries published via github so all we
need to do is build an EFI partition and place things in the right place.
There are some additional Linux based tests which are left for later.

---
   tests/functional/aarch64/meson.build       |  1 +
   tests/functional/aarch64/test_virt_vbsa.py | 99 ++++++++++++++++++++++
   2 files changed, 100 insertions(+)

create mode 100755 tests/functional/aarch64/test_virt_vbsa.py

tests/functional/aarch64/meson.build +1 -0
index 49eca120589..7ea8c22b048 100644
@@ -46,6 +46,7 @@ tests_aarch64_system_thorough = [
     'tuxrun',
     'virt',
     'virt_gpu',
+  'virt_vbsa',
     'xen',
     'xlnx_versal',
   ]
tests/functional/aarch64/test_virt_vbsa.py new file +19 -0
new file mode 100755
index 00000000000..53cabf9d6c5
@@ -0,0 +1,99 @@
+#!/usr/bin/env python3
+#
+# Functional test that runs the Arm VBSA conformance tests.
+#
+# Copyright (c) 2026 Linaro Ltd.
+#
+# Author:
+#  Alex Bennée <[email protected]>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import shutil
+from subprocess import check_call, DEVNULL
+
+from qemu_test import QemuSystemTest, Asset
+from qemu_test import wait_for_console_pattern, get_qemu_img, skipIfMissingCommands
+from qemu_test import exec_command_and_wait_for_pattern as ec_and_wait
+
+

tests/functional/aarch64/test_virt_vbsa.py line 29

Quoted 10 lines
tests/functional/aarch64/test_virt_vbsa.py new file +10 -0
+@skipIfMissingCommands("mformat", "mcopy", "mmd")
+class Aarch64VirtMachine(QemuSystemTest):
+    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
+    timeout = 360
+
+    def wait_for_console_pattern(self, success_message, vm=None):
+        wait_for_console_pattern(self, success_message,
+                                 failure_message='Kernel panic - not syncing',
+                                 vm=vm)
+

May be worth adding a comment with README url:
https://github.com/ARM-software/sysarch-acs/blob/main/docs/vbsa/README.md

Quoted 63 lines
tests/functional/aarch64/test_virt_vbsa.py new file +63 -0
+    ASSET_VBSA_EFI = Asset('https://github.com/ARM-software/sysarch-acs/raw/refs/heads/main'
+                           '/prebuilt_images/VBSA/v25.12_VBSA_0.7.0/Vbsa.efi',
+                           '80f37d2fb86d152d95dec4d05ff099c9e47ee8a89314268e08056b0e1359e1fa')
+
+    ASSET_BSA_SHELL = Asset('https://github.com/ARM-software/bsa-acs/raw/refs/heads/main/'
+                            'prebuilt_images/BSA_DT/v20.05_05_ALPHA/Shell.efi',
+                            '763e7b293fa9d1582153ea8fd0cf60e2a7a87d092d35d342cf9b3b697f47b588')
+
+    def test_aarch64_vbsa_uefi_tests(self):
+        """
+        Launch the UEFI based VBSA test from an EFI file-system
+        """
+
+        self.vm.set_console()
+
+        # virt machine wi
+        self.set_machine('virt')
+        self.vm.add_args('-M', 'virt,gic-version=max,virtualization=on')
+        self.vm.add_args('-cpu', 'max','-m', '1024')
+
+        # We will use the QEMU firmware blobs to boot
+        code_path = self.build_file('pc-bios', 'edk2-aarch64-code.fd')
+        vars_source = self.build_file('pc-bios', 'edk2-arm-vars.fd')
+        vars_path = self.scratch_file('vars.fd')
+        shutil.copy(vars_source, vars_path)
+
+        self.vm.add_args('-drive', f'if=pflash,format=raw,readonly=on,file={code_path}')
+        self.vm.add_args('-drive', f'if=pflash,format=raw,file={vars_path}')
+
+        # Build an EFI FAT32 file-system for the UEFI tests
+        vbsa_efi = self.ASSET_VBSA_EFI.fetch()
+        bsa_shell = self.ASSET_BSA_SHELL.fetch()
+
+        img_path = self.scratch_file('vbsa.img')
+        qemu_img = get_qemu_img(self)
+        check_call([qemu_img, 'create', '-f', 'raw', img_path, '64M'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mformat', '-i', img_path, '-v', 'VBSA', '::'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mmd', '-i', img_path, '::/EFI'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mmd', '-i', img_path, '::/EFI/BOOT'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mcopy', '-i', img_path, bsa_shell, '::/EFI/BOOT/BOOTAA64.EFI'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        check_call(['mcopy', '-i', img_path, vbsa_efi, '::/Vbsa.efi'],
+                   stdout=DEVNULL, stderr=DEVNULL)
+
+        self.vm.add_args('-drive', f'file={img_path},format=raw,if=none,id=drive0')
+        self.vm.add_args('-device', 'virtio-blk-pci,drive=drive0')
+
+        self.vm.launch()
+
+        # wait for EFI prompt
+        self.wait_for_console_pattern('Shell>')
+
+        # Start the VBSA tests
+        ec_and_wait(self, "FS0:Vbsa.efi", 'VBSA Architecture Compliance Suite')
Quoted 8 lines

tests/functional/aarch64/test_virt_vbsa.py line 97

Quoted 5 lines
tests/functional/aarch64/test_virt_vbsa.py new file +5 -0
+
+        # could we parse the summary somehow?
+
+        self.wait_for_console_pattern('VBSA tests complete. Reset the system.')
+

What happens in case there is an error, does the test app hangs, or still exit with message under?

Quoted 5 lines

The failures I had were generally hangs but ideally we would parse the the summary data and generate our response based on that. Unfortunately that is at odds with the current send/wait for pass/fail message infrastructure.

I'm not sure you need something so complicated, all we needed is to return an error if any test is failing,(assuming they all pass now?). I don't know the output format, but let's imagine a failure is reported with "not ok ... details ...", all you need to modify is the final wait_for_console_pattern:

wait_for_console_pattern(self, 'VBSA tests complete. Reset the system.',
failure_message='not ok')

So it will catch any failure without having to parse anything.

Regards,
Pierrick