public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: buildroot@buildroot.org
Cc: Romain Naour <romain.naour@gmail.com>
Subject: [Buildroot] [PATCH v6 5/6] support/testing: add test for kvm-unit-tests
Date: Wed, 25 Feb 2026 10:55:34 +0000	[thread overview]
Message-ID: <20260225105537.1420002-6-alex.bennee@linaro.org> (raw)
In-Reply-To: <20260225105537.1420002-1-alex.bennee@linaro.org>

Now we have updated kvm-unit-tests we should defend it with a test. To
support that enable KVM in the qemu kernel config and boot an image
where we can run the basic tests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 board/qemu/aarch64-virt/linux.config      |  2 +
 support/testing/tests/package/test_kvm.py | 47 +++++++++++++++++++++++
 2 files changed, 49 insertions(+)
 create mode 100644 support/testing/tests/package/test_kvm.py

diff --git a/board/qemu/aarch64-virt/linux.config b/board/qemu/aarch64-virt/linux.config
index 971b9fcf86..9d1934c648 100644
--- a/board/qemu/aarch64-virt/linux.config
+++ b/board/qemu/aarch64-virt/linux.config
@@ -74,3 +74,5 @@ CONFIG_VIRTIO_FS=y
 CONFIG_OVERLAY_FS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=y
diff --git a/support/testing/tests/package/test_kvm.py b/support/testing/tests/package/test_kvm.py
new file mode 100644
index 0000000000..da5ebfb1b7
--- /dev/null
+++ b/support/testing/tests/package/test_kvm.py
@@ -0,0 +1,47 @@
+import os
+import infra.basetest
+
+KVM_TIMEOUT = 120
+
+
+class TestKVM(infra.basetest.BRTest):
+    config = \
+        """
+        BR2_aarch64=y
+        BR2_cortex_a72=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_LIBC_UTILS_COPY=y
+        BR2_OPTIMIZE_S=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        BR2_LINUX_KERNEL=y
+        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
+        BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+        BR2_PACKAGE_KVM_UNIT_TESTS=y
+        # BR2_PACKAGE_QEMU_SYSTEM_TCG is not set
+        # BR2_PACKAGE_QEMU_BLOBS is not set
+        BR2_TARGET_ROOTFS_EXT2=y
+        """
+
+    def test_run(self):
+        kern = os.path.join(self.builddir, "images", "Image")
+        img = os.path.join(self.builddir, "images", "rootfs.ext2")
+
+        qemu_opts = ["-M", "virt,gic-version=3,virtualization=on",
+                     "-cpu", "cortex-a72",
+                     "-smp", "2",
+                     "-m", "512M",
+                     "-drive", f"file={img},if=virtio,format=raw", "-snapshot"]
+
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["root=/dev/vda console=ttyAMA0"],
+                           options=qemu_opts)
+
+        self.emulator.login()
+
+        # Run the selftests
+        self.assertRunOk("/usr/share/kvm-unit-tests/selftest-setup")
+        self.assertRunOk("/usr/share/kvm-unit-tests/selftest-smp")
+        self.assertRunOk("/usr/share/kvm-unit-tests/selftest-vectors-kernel")
+        self.assertRunOk("/usr/share/kvm-unit-tests/selftest-vectors-user")
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-02-25 10:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 10:55 [Buildroot] [PATCH v6 0/6] kvm-unit-tests: update deps and fine tune qemu Alex Bennée
2026-02-25 10:55 ` [Buildroot] [PATCH v6 1/6] toolchain/external: allow installing of libc utils Alex Bennée
2026-03-10 21:53   ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 2/6] package/kvm-unit-tests: update dependencies Alex Bennée
2026-03-10 22:02   ` Romain Naour via buildroot
2026-03-10 22:07     ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 3/6] package/kvm-unit-tests: bump to v2025-07-31 Alex Bennée
2026-03-10 22:09   ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 4/6] package/kvm-unit-tests: honour BR2_ARM64_PAGE_SIZE Alex Bennée
2026-03-10 22:16   ` Romain Naour via buildroot
2026-02-25 10:55 ` Alex Bennée [this message]
2026-03-10 22:31   ` [Buildroot] [PATCH v6 5/6] support/testing: add test for kvm-unit-tests Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 6/6] package/kvm-unit-tests: allow kvmtool to be used Alex Bennée
2026-03-10 22:44   ` Romain Naour via buildroot

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=20260225105537.1420002-6-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=buildroot@buildroot.org \
    --cc=romain.naour@gmail.com \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox