Files
buildroot/support/testing/tests/package/test_msr_tools.py
Julien Olivain 37bc7f99fd support/testing: test_msr_tools: fix test after bootlin toolchains update
Since Buildroot commit [1] "update to Bootlin toolchains 2025.08-1",
the tests.package.test_msr_tools fails when building its Kernel 5.15.55
with gcc 15.1.0.

This commit fixes the issue by updating the test Kernel to the latest
LTS version (6.12.42 at the time of this commit) which includes the
fix for gcc-15. Note: the 5.15.y series does not include this fix for
the x86_64 architecture, which is why this commit switches to 6.12.y.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/10984686294

[1] 947dbc92a2

Cc: Vincent Stehlé <vincent.stehle@laposte.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-08-16 21:46:05 +02:00

51 lines
1.6 KiB
Python

import os
import infra.basetest
class TestMsrTools(infra.basetest.BRTest):
config = \
"""
BR2_x86_64=y
BR2_x86_corei7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.42"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config"
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}"
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
BR2_PACKAGE_MSR_TOOLS=y
BR2_TARGET_ROOTFS_CPIO=y
# BR2_TARGET_ROOTFS_TAR is not set
""".format(
infra.filepath("tests/package/test_msr_tools/linux.config"))
def test_run(self):
kernel = os.path.join(self.builddir, "images", "bzImage")
cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
self.emulator.boot(
arch="x86_64",
kernel=kernel, kernel_cmdline=["console=ttyS0"],
options=["-cpu", "Nehalem", "-m", "320", "-initrd", cpio_file]
)
self.emulator.login()
# CPU ID.
cmd = "cpuid"
self.assertRunOk(cmd)
# Write MSR.
# We write to TSC_AUX.
cmd = "wrmsr 0xc0000103 0x1234567812345678"
self.assertRunOk(cmd)
# Read MSR.
# We read back the TSC_AUX and we verify that we read back the correct
# value.
cmd = "rdmsr 0xc0000103"
output, exit_code = self.emulator.run(cmd)
self.assertEqual(exit_code, 0)
self.assertEqual(output[0], "1234567812345678")