From: Bastien Curutchet via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Fiona Klute <fiona.klute@gmx.de>,
Bastien Curutchet <bastien.curutchet@bootlin.com>
Subject: [Buildroot] [PATCH v4 2/2] support/testing: add rasdaemon tests
Date: Fri, 19 Dec 2025 17:30:16 +0100 [thread overview]
Message-ID: <20251219-rasdaemon-v4-2-2cdc992de787@bootlin.com> (raw)
In-Reply-To: <20251219-rasdaemon-v4-0-2cdc992de787@bootlin.com>
Rasdaemon was added in previous patch.
Add a test_rasdaemon that allows to test it.
Test is done on x86. It first checks the daemon's version, then mounts
debugfs and finally ensures that the init script allows to
start/restart/stop the daemon.
Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
---
DEVELOPERS | 1 +
support/testing/tests/package/test_rasdaemon.py | 46 ++++++++++++++++++++++
.../package/test_rasdaemon/linux-debugfs.fragment | 8 ++++
3 files changed, 55 insertions(+)
diff --git a/DEVELOPERS b/DEVELOPERS
index b1ead6d26c4e8ff160bcc7ed85b0945ac5e551dc..c9aaa8c9c8aa3d54c930476d9d450e7f990d9aac 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -343,6 +343,7 @@ F: package/uhubctl/
N: Bastien Curutchet <bastien.curutchet@bootlin.com>
F: package/rasdaemon/
+F: support/testing/tests/package/test_rasdaemon.py
N: Baxiche Su <baxiche@gmail.com>
F: package/qt6/qt6multimedia/
diff --git a/support/testing/tests/package/test_rasdaemon.py b/support/testing/tests/package/test_rasdaemon.py
new file mode 100644
index 0000000000000000000000000000000000000000..bc800b6ccbea1c18f4c970d87bea0395c64ad952
--- /dev/null
+++ b/support/testing/tests/package/test_rasdaemon.py
@@ -0,0 +1,46 @@
+import os
+
+import infra.basetest
+
+
+class TestRasdaemon(infra.basetest.BRTest):
+ config = f"""
+ BR2_x86_64=y
+ BR2_x86_corei7=y
+ BR2_INIT_SYSV=y
+ BR2_LINUX_KERNEL=y
+ BR2_TOOLCHAIN_EXTERNAL=y
+ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.59"
+ BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86/linux.config"
+ BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{infra.filepath("tests/package/test_rasdaemon/linux-debugfs.fragment")}"
+ BR2_PACKAGE_RASDAEMON=y
+ BR2_PACKAGE_RASDAEMON_AER=y
+ BR2_PACKAGE_LIBTRACEEVENT=y
+ BR2_PACKAGE_SQLITE=y
+ BR2_PACKAGE_PCIUTILS=y
+ BR2_TARGET_ROOTFS_CPIO=y
+ # BR2_TARGET_ROOTFS_TAR is not set
+ """
+
+ 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", "-initrd", cpio_file],
+ )
+ self.emulator.login()
+
+ self.assertRunOk("/usr/sbin/rasdaemon --version")
+ self.assertRunOk("mount -t debugfs nodev /sys/kernel/debug")
+ self.assertRunOk("/etc/init.d/S95rasdaemon start")
+ self.assertRunOk("pidof /usr/sbin/rasdaemon")
+ self.assertRunOk("/etc/init.d/S95rasdaemon restart")
+ self.assertRunOk("pidof /usr/sbin/rasdaemon")
+ self.assertRunOk("/etc/init.d/S95rasdaemon stop")
+ _, ret = self.emulator.run("pidof /usr/sbin/rasdaemon")
+ self.assertNotEqual(ret, 0)
diff --git a/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment b/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment
new file mode 100644
index 0000000000000000000000000000000000000000..a334bc373179623f3c5b2c3727ee7738a0c2542e
--- /dev/null
+++ b/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment
@@ -0,0 +1,8 @@
+CONFIG_DEBUG_FS=y
+CONFIG_FTRACE=y
+CONFIG_USER_EVENTS=y
+CONFIG_TRACE_EVENT_INJECT=y
+CONFIG_PCI=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+CONFIG_MEMORY_FAILURE=y
--
2.52.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2025-12-19 16:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 16:30 [Buildroot] [PATCH v4 0/2] package: add rasdaemon support Bastien Curutchet via buildroot
2025-12-19 16:30 ` [Buildroot] [PATCH v4 1/2] package/rasdaemon: Add rasdaemon package Bastien Curutchet via buildroot
2025-12-31 9:46 ` Thomas Petazzoni via buildroot
2025-12-19 16:30 ` Bastien Curutchet via buildroot [this message]
2025-12-31 9:48 ` [Buildroot] [PATCH v4 2/2] support/testing: add rasdaemon tests Thomas Petazzoni 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=20251219-rasdaemon-v4-2-2cdc992de787@bootlin.com \
--to=buildroot@buildroot.org \
--cc=bastien.curutchet@bootlin.com \
--cc=fiona.klute@gmx.de \
--cc=thomas.petazzoni@bootlin.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